Is UIGetScreenImage returning an image of whatever is on the screen or is it limited to the screen shown when a camera view is displayed?
it returns whatever's on the screen, so if you only want to capture the camera preview image, you need to crop the image UIGetScreenImage returns.
Related
I was taking photos through UIImagePickerController. When I captured a photo in Portrait mode, it was correctly displayed. But when i captured photo in Landscape mode it automatically rotated into portrait mode and was then displayed.
What are the possible ways to display a captured photo in Landscape mode when i capture photo in Landscape orientation.
Thanks in advance.
Is it possible if using CameraOverlayView??????
Have a single method for orientation purposes and call it everytime -BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation is called.
You can save the image with its UIImageOrientation attribute using the method:
- (id)initWithCGImage:(CGImageRef)imageRef scale:(CGFloat)scale orientation:(UIImageOrientation)orientation
This way, you can control the zoom as well, with the variable scale. You can refer to the various orientation values and use device orientation at the time of capturing the UIImage
My application have an function that allow user to move and scale the image just like setting allowsEditing = YES with UIImagePickerController.
My approach is having a scrollview which allow user to zoom with level 1-4
There is only a image view on the scrollview.
At the end, I want to crop the image as the screen size. How can I do it?
The trick is to capture the layer of the view containing the scaled / rotated image. In this case you need to capture the scrollview layer NOT the image itself.
I have a UIImage capture category for this...check out my article and download the source code.
UPDATE: to crop part of the image as per the comment below...
First capture the whole view then crop the image to the specified rect using the following method in the UIImage+Resize category (also in the article...)
- (UIImage *)croppedImage:(CGRect)bounds;
I am working on camera application in which I want to set the screen of the camera i.e camera window appear for particular frame. And in front of camera screen the cut out image is coming so that user can see the background through the cut out part of the image and capture the image. So any one know to do this i.e. customization of UIImagePickerController.
UIImagePickerController has a property named cameraOverlayView. Use this to set your camera overlay as any view you like. Use normal view transparency for letting the user see parts of the live camera view.
How do I use UIImagePickerController to show a overlay (say a small circle)?
Also when the user clicks the picture, only the part of the photo inside the circle is returned, how do I go about that?
I will like to visualize the images from the Camera roll from my application. Something like with the Album app which let you zoom and pan pictures. I tried using the UIImagePickerController with UIImagePickerControllerSourceTypeSavedPhotosAlbum as sourceType but unfortunatly if a tap a picture, the didFinishPickingMediaWithInfo is called with the picture selected.
Thanks!
I believe that the image picker is currently the best you can get. If you want zoom and panning you’ll have to write the code yourself (using the UIImage returned from the image picker).