Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Take a picture, choose between Full or Square Mode in camera

Is there a way to use the overlays in the UIImagePickerController to show the square picture a user might use, while having a toggle button in there somewhere to switch on the fly?

Currently the iOS 7 camera has this capability, but UIImagePickerController does not (thanks Apple), so is there a way to add this functionality?

Would using AVCaptureSession be necessary? It seems like serious overkill, and I'd have to program flash/focus/etc all over again, I think.

Failing that, is there a customizable class that already exists that I could just implement?

I'm banging my head against the wall trying to figure out the best course of action here, so any help would be appreciated.

like image 815
Rob Avatar asked Oct 25 '13 03:10

Rob


People also ask

How do you take a picture in square mode?

Either swipe up anywhere on the screen or tap the chevron (arrow) icon at the top of the screen. This brings up all the extra options at the bottom of the viewfinder. Tap “4:3” (that's the iPhone camera's default crop). Tap “Square” to switch from 4:3 mode to Square mode.

What is square mode in iPhone camera?

Square. Square mode limits the frame of your camera screen to a square — the optimal photo size for many social media apps. So when you take a photo, you can quickly share it on your favorite social platforms.


1 Answers

You can adjust the camera view by transforming the scale

CGAffineTransform transform = CGAffineTransformMakeScale(1.0, 0.5);
imagePickerController.cameraViewTransform = transform;

with the arguments being the scale to change the x and y axis of the camera screen by. You could add a button that re-presents the camera view within the view controller at the top of your hierarchy. It may not perfectly recapitulate the native phone app, but it will be a pretty good approximation.

like image 98
jeremyw Avatar answered Nov 06 '22 03:11

jeremyw