Sezhian
Sezhian

Reputation: 333

How to change the size of UIImagePickerController in iPAD?

How to make the UIImagePickerController size bigger in iPAD? Example MAC PhotoBoth application. http://www.youtube.com/watch?v=Ytl3EhNCP_8.

The code already i have done.

- (void)openCamera {

    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        camera = [[UIImagePickerController alloc] init];
        camera.sourceType = UIImagePickerControllerSourceTypeCamera;
        camera.cameraDevice = UIImagePickerControllerCameraDeviceFront;
        camera.delegate = self;

        [self presentViewController:camera sender:nil animated:YES modal:YES];
    }
    else 
    {
        UIAlertView *objAlert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Camera not found" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];

        [objAlert show];
        [objAlert release];
    }
}


- (void)presentViewController:(UIViewController *)vc
                       sender:(id)sender
                     animated:(BOOL)animated
                        modal:(BOOL)modal {

    CGRect cframe = self.capturedImage.bounds;
    //cframe =  CGRectMake(cframe.origin.x, cframe.origin.y/2.0, 351, 351);


    photoPopoverController = [[UIPopoverController alloc] initWithContentViewController:vc];
    [photoPopoverController presentPopoverFromRect:[capturedImage bounds] inView:capturedImage permittedArrowDirections:UIPopoverArrowDirectionUnknown animated:YES];
}

Upvotes: 1

Views: 4615

Answers (2)

marceloquinta
marceloquinta

Reputation: 703

You can use transform:

//The transform factor

#define CAMERA_TRANSFORM 0.34 and above

and above, when you want to resize it, use:

camera.wantsFullScreenLayout = YES;

camera.cameraViewTransform = CGAffineTransformScale(camera.cameraViewTransform,CAMERA_TRANSFORM, CAMERA_TRANSFORM);

Upvotes: 3

marzapower
marzapower

Reputation: 5611

You should change the frame property of its view. I.e.

UIView *view = imagePickerController.view;
CGRect frame = view.frame;
frame.size.height = new_height;
frame.size.width = new_width;
view.frame = frame;

It should work. Otherwise, please, give us more detail about how you create the controller, how you display it and which are its delegates.

Upvotes: 2

Related Questions