Question

Hi i am new to the iOS.

I wish to implement photo editing functionality in my app. that photo will be retrieve from iPhone photo library. I tried to place the photo in UIImageView. but i did not get better result. UIImageview does not show the photo as its being in photo album. there is lots of resolution and quality is missing.

If i want to show photo with original resolution and quality as its being in photo album. what are steps i need to follow. if any one knows please guide me right way.

    editingPhotoContainerIMV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, self.view.frame.size.height)];
    [editingPhotoContainerIMV setContentMode:UIViewContentModeScaleAspectFit];
Was it helpful?

Solution

If the problem is you are on a Retina device, when you load your UIImage, you should be using:

UIImage *photoImage = [UIImage imageWithCGImage:(CGImageRef)imageRef scale:2 orientation: UIImageOrientationUp];

EDIT: Assuming the problem IS with Retina devices, then you need to get a CGImageRef. If you already have the UIImage, then you can replace 'imageRef' above with 'myUIimage.CGImage'. If not, if he image is in a file, then you can use UIImage's initWithContentsOfFile - look at the UIImage class reference. The key is to get the CGImage out of the UIImage, then get a new image with a scale factor of 2. The only way iOS lets you do that is with the method I showed up top.

OTHER TIPS

Try ALAssetRepresentation fullResolutionImage

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top