Search code examples
iphonecameraphototake

custom camera zoom Functionality IPhone Take Photo


I am successfully able to Make custom Zoom using Slider in my Custom Camera view using following code

imagePickerController.cameraViewTransform = CGAffineTransformScale(initialTransform, MainSlider.value, MainSlider.value); 

Screen Looks Zoom as it should be ... But when i call Take Picture function

[self.imagePickerController takePicture];

and tryng to access Photo in method :

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {



UIImage *Originalimage = [info valueForKey:UIImagePickerControllerOriginalImage];


UIImage *Editimage = [info valueForKey:UIImagePickerControllerEditedImage];


}

Here I receive Original Image without Zoom n "Originalimage" but i dont get anything in "Editimage"

I am trying to get Image with Zoom that i get using cameraViewTransform!!

I hope its more clear now ... .

Thank you


Solution

  • Ok .. I got indirect way to get the zoomed image ....

    Once i zoom image and take picture , I take the Originial picture and zoom that Image upto that scale ... and than use of this function "UIGraphicsGetImageFromCurrentImageContext" for selected bound ...

    And i get that zoomed image ...

    Still i dont know why i dont get anything in UIImagePickerControllerEditedImage , May be i am editing nothing... just scaling it ... may be thats why its not giving me anythiing in Edited Image ...

    Thank you for your help and support !!