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 album
Displaying in app
After changing [editingPhotoImgVw setContentMode:UIViewContentModeScaleAspectFit]; into [editingPhotoImgVw setContentMode:UIViewContentModeScaleToFill]; as per iSanjay comments
You are using Image Content Mode like
[editingPhotoImgVw setContentMode:UIViewContentModeScaleAspectFit];
Instead of this try
[editingPhotoImgVw setContentMode:UIViewContentModeScaleToFill];
Do this .