3

Hi i am new to the iOS.

I am developping one app, it contain photo editing feature. for that purpose i can pick the photo from photo library. i could successfully pick the photo and place it in UIImageView.but i feel its not that much good. it has lots of different that displaying in photo album and displaying in UIImageView.

I wish to display it like displaying in photo album. How can i achieve this?

Please guide me.

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    // Access the uncropped image from info dictionary
    UIImage *originalImage = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
    NSLog(@"size of originalImage is %@",NSStringFromCGSize(originalImage.size));
    editingPhotoImgVw.frame = CGRectMake(0, 0, 320,self.view.frame.size.height);
    editingPhotoImgVw.image =originalImage;
    [editingPhotoImgVw setContentMode:UIViewContentModeScaleAspectFit];
    [self.view addSubview:editingPhotoImgVw];
    [self dismissModalViewControllerAnimated:YES];
    [picker release];

}

Displaying in photo albumenter image description here

Displaying in app enter image description here

After changing [editingPhotoImgVw setContentMode:UIViewContentModeScaleAspectFit]; into [editingPhotoImgVw setContentMode:UIViewContentModeScaleToFill]; as per iSanjay comments enter image description here

thavasidurai
  • 1,972
  • 1
  • 26
  • 51

1 Answers1

1

You are using Image Content Mode like

[editingPhotoImgVw setContentMode:UIViewContentModeScaleAspectFit];

Instead of this try

[editingPhotoImgVw setContentMode:UIViewContentModeScaleToFill];

Do this .

iSanjay
  • 173
  • 11
  • Yes its almost working but still i could feel some noises are there. – thavasidurai Sep 12 '12 at 07:11
  • can you post your current image now. so i can see – iSanjay Sep 12 '12 at 07:16
  • this problems is in your first image also.. see the image quality becomes poor after displaying in uiimageview. other than it doesn't matter which mode are you using.Its Resolution problem your iPhone Camrea resolution is high thats why this problem appears. – iSanjay Sep 12 '12 at 07:23
  • Is there any way to achieve like photo album image quality. – thavasidurai Sep 12 '12 at 07:27
  • See This [link](http://stackoverflow.com/questions/3978211/uiviewcontentmodescaleaspectfit-iphone-sdk-gives-poor-quality-image) – iSanjay Sep 12 '12 at 07:31