I'm not having a problem setting a UIImageView in my controller from the image selected in my UIImagePickerController; however, I CANNOT for the life of me, figure out how to apply the editing information to that UIImageView
I have my image being set correctly and passing the 'UIImage' reference to my ViewController (I'm not saving the photo yet on purpose):
Code:
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
// SAVE THE IMAGE to the DOCSFOLDER
int i = 0;
/* Do not want to save file just yet....
NSString *uniquePath = [DOCSFOLDER stringByAppendingPathComponent:@"selectedImage.png"];
while([[NSFileManager defaultManager] fileExistsAtPath:uniquePath])
{
uniquePath = [NSString stringWithFormat:@"%@%@-%d.%@", DOCSFOLDER,@"selectedImage", ++i, @"png"];
}
[UIImagePNGRepresentation(image) writeToFile:uniquePath atomically:YES];
*/
// pass the image to the ViewController
[controller setActiveImage:image];
// control ends
[[self parentViewController] dismissModalViewControllerAnimated:YES];
[picker release];
}
Then in my ViewController I set a UIImageView:
Code:
-(void)setActiveImage:(UIImage *)img{
image = img;
UIImageView *imgView = [[UIImageView alloc] initWithImage: image];
[contentView addSubview:imgView];
[img release];
[imgView release];
}
If anyone knows how to apply the 'editingInfo' to the UIImageView, it's greatly appreciated and thank you in advance.