Camera photo mode fullscreen on iOS7 - ios

Is there a way to set the camera photo mode fullscreen on an iPod 5gen with iOS7.1? When you are going to take a photo, the photo mode is not in fullscreen, only the video mode is in fullscreen, so, is there a way to change it? (I think the same problem must happen on an iPhone 5 and greater).
Here is my code so far, it displays the control but partially, not fullscreen, and the control gets aligned to the top because the camera controls are removed from the view:
self.picker = [[UIImagePickerController alloc] init];
self.picker.delegate = self;
self.picker.allowsEditing = NO;
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.showsCameraControls = NO;
//self.picker.mediaTypes = mediaTypes; //just for the record
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.modalPresentationStyle = UIModalPresentationFullScreen;
self.picker.cameraOverlayView = [self buildOverlay]; //some custom views
[self presentViewController:self.picker animated:YES completion:NULL];
Thank you very much in advance.

Apply proper CGAffineTransform transformation in order to set camera mode.
Try out the following link this may help you:
here

Related

MPMoviePlayerViewController has aspect ration wrong for a split second

I create a movie using UIImagePickerController using the following:
self.cameraUI = [[UIImagePickerController alloc] init];
self.cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
self.cameraUI.mediaTypes = #[(NSString *)kUTTypeMovie];
self.cameraUI.delegate = self;
self.cameraUI.videoQuality = UIImagePickerControllerQualityTypeMedium;
self.cameraUI.cameraDevice = UIImagePickerControllerCameraDeviceFront;
In the playback of the video I see that it looks good.
Then I try to load the movie with MPMoviePlayerViewController
self.player = [[MPMoviePlayerViewController alloc] initWithContentURL:self.chacha];
self.player.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[self presentMoviePlayerViewControllerAnimated:self.player];
For a split second when the movie view controller is presented the aspect ratio goes from warped to correct.
Anyone know what might be causing this? I have messed with settings for the movie controller and nothing there I have tried has helped.
Perhaps you could render it off-screen, or set it's Hidden property to YES until it finishes loading and you're sure the aspect ratio is correct.
I don't have much experience with that player.

Objective-C Camera Crop Size

I have a routine that I use to trigger the camera to take a photo. After the camera takes the photo the user is then given an option to crop the image by default before the delegate passes me back the UIImage. Is there any way that I can pass in a dynamic CGRect to make this default crop area a specific size? One thing I should mention is that the application is a landscape iPad application.
Here is a code sample:
-(void)triggerCamera:(id)sender
{
UIImagePickerController *camera = [[UIImagePickerController alloc] init];
camera.delegate = self;
camera.allowsEditing = YES;
camera.sourceType = UIImagePickerControllerSourceTypeCamera;
//pass in some sort of CGRect ??
[self presentViewController:camera animated:YES completion:NULL];
}
-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info {
UIImage *img = [info objectForKey: UIImagePickerControllerOriginalImage];
//process my image further
}
Unfortunately you can't set crop size. I was dealing with same problem over 2 years ago and I got stuck with creating my own viewController for cropping image.
Maybe take a look at GKImagePicker on GitHub. This project hasn't had much activity in the past few months (maybe more), but could be worth a shot. It even comes with an option to have a resizable crop area. I have not tried it myself, but the implementation looks to be pretty simple:
self.imagePicker = [[GKImagePicker alloc] init];
self.imagePicker.cropSize = CGSizeMake(320, 90);
self.imagePicker.delegate = self;
[self presentModalViewController:self.imagePicker.imagePickerController animated:YES];

Need help calling imagePickerController's "Editing mode"

I've searched everywhere and cannot find a solid answer to this. Is there any way to programatically call a imagePickerController's "edit" photo mode (i.e. the mode where you crop photo taken into a square)?
The reason I'm asking is because I have a custom overlay view and a custom "take photo" button, but I want to edit the image afterwards. I have set the allowsEditing attribute to YES but
[camera takePicture];
Just calls the didFinishPickingMediaWithInfo right after the image is taken. It doesn't go to the "edit" mode view at all. Is there a solution to this?
My code for the image picker:
camera = [[UIImagePickerController alloc] init];
camera.delegate = self;
camera.sourceType = UIImagePickerControllerSourceTypeCamera;
camera.cameraDevice = UIImagePickerControllerCameraDeviceRear;
camera.showsCameraControls = NO;
camera.navigationBarHidden = YES;
camera.toolbarHidden = YES;
camera.wantsFullScreenLayout = NO;
camera.allowsEditing = YES;
camera.cameraOverlayView = overlay;
Edit: added more code
Post your code on how you are presenting the imagePickerContorller
imagePicker.allowsEditing = YES; is what you use to allow editing of the image after image is taken
try adding [cameraOverlayView setUserInteractionEnabled:NO];

Setting Move and Scale Box for iOS

I have seen several apps that after you take a picture, it shows a view for Move and Scale your picture, with a box showing what the resulting image will look like. My app takes a picture the user takes or picks from library, and adds it to a PDF file. I need this file to be a certain size to fit on the PDF, so I need to set the move and scale box accordingly, but I cannot find any documentation on how to do this. Any suggestions?
Just set the UIImagePickerController instance's allowsEditing to YES.
_imagePickerController = [[UIImagePickerController alloc] init];
...
_imagePickerController.delegate = self;
_imagePickerController.allowsEditing = YES;
The UIImagePickerController picker ONLY performs 320x320 cropping.
Try using this: https://github.com/gekitz/GKImagePicker (GKImagePicker)
Sample Code:
self.imagePicker = [[GKImagePicker alloc] init];
self.imagePicker.cropSize = CGSizeMake(320, 90);
self.imagePicker.delegate = self;
[self presentModalViewController:self.imagePicker.imagePickerController animated:YES];

iOS6 Camera Overlay Does Not Allow Editing

In my app, I need to have a Camera Overlay to help the user line up the picture correctly for it's intended use. Further, I need to have the Editing interface to let them fine tune the zoom and alignment with this "guide". I have gotten the Camera overlay to work with the default Camera Controls (the editing pane won't even show unless you use the default controls) , however now on the editing screen, I cannot zoom/pan. The touch events seem to occur on the overlay, and not the editing screen. I know/knew this was a potential problem, and have implemented the fix mentioned here
This allows focusing on the camera screen itself, you can see the touches are being passed through/ignored in the overlay, but on the editing screen this is still not working. I have also tried some of the hittest code found here
That solution gives me an error every time that No visible #interface for 'UIViewController' declares the selector 'hitTest:withEvent:' on the super line.
I have also tried all kinds of settings playing with the userInteractionEnabled property
Here is the code I am using to do the overlay:
self.picker = [[UIImagePickerController alloc] init];
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
self.picker.showsCameraControls = YES;
self.picker.navigationBarHidden = YES;
self.picker.toolbarHidden = YES;
self.picker.wantsFullScreenLayout = YES;
self.picker.allowsEditing = YES;
self.picker.view.userInteractionEnabled = YES;
// Insert the overlay
self.overlay = [[OverlayViewController alloc] initWithNibName:#"OverlayViewController" bundle:nil];
self.overlay.pickerReference = self.picker;
self.picker.cameraOverlayView = self.overlay.view;
[self.picker.cameraOverlayView setUserInteractionEnabled:YES];
//[self.picker.cameraOverlayView setUserInteractionEnabled:FALSE];
self.picker.delegate = self.overlay;
// [self performSelector:#selector(moveOverlayViewToSublayer:) withObject:self.picker afterDelay:0.1f];
[self presentModalViewController:self.picker animated:NO];
I had trouble getting a custom overlay working using a xib file and ended up just creating the overlay view in code.
There are examples of how to achieve this around the Net:
http://www.musicalgeometry.com/?p=821
https://developer.apple.com/library/ios/#samplecode/PhotoPicker/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010196

Resources