Hi how can i retrieve image from specified image path in iphone. In my code is
- (void)imagePickerController:(UIImagePickerController *)UIPicker didFinishPickingImage:(UIImage *)info editingInfo:(NSDictionary *)dictionary
{
imageView.image=info;
[UIPicker dismissModalViewControllerAnimated:YES];
NSLog(@"UImage path= %@",imageView.image);
NSData* imageData = UIImagePNGRepresentation(imageView.image);
NSString* imageName = @"MyImage.png";
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* documentsDirectory = [paths objectAtIndex:0];
NSString *fullPathToFile = [documentsDirectory stringByAppendingPathComponent:imageName];
[imageData writeToFile:fullPathToFile atomically:NO];
NSLog(@"Image path = %@",fullPathToFile);
}
When i select image, the image should be placed, it will successfully placed to uiimage view. And i got the image path.
When i execute the application in console it showed
Image path=document = /Users/rr-mac/Library/Application Support/iPhone Simulator/4.3/Applications/46C716D0-13E9-4DF2-BC46-F1071DFCE14C/Documents/MyImage.png
My image is stored in this specified path. Here how can i retrieve this image and placed to imageview. Anybody help me to give the code.
Thanks in Advance.
To retrieve the UIImage in directory path, you should use :
Full Code :