どのボディからでも、UIIMAGEPICKERが画像をトリミングできる方法を教えてください。また、画像のパスをdatabseに保存して再利用するために、このトリミング画像をiphoneディレクトリに保存できますか?
回答:
回答№1は1これを試して:
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info{
UIImage *img = [info objectForKey:UIImagePickerView.UIImagePickerControllerEditedImage];
//I think that"s how you"re supposed to get the image. Fiddle with it.
img.size = CGSizeMake(x, y);
img.scale = 0.75; //scale the image to 75 percent of it"s original size.
UIImageWriteToSavedPhotosAlbum (*img, self, @selector(photoSaved), nil);
}
-(void)photoSaved image: (UIImage *) image
didFinishSavingWithError: (NSError *) error
contextInfo: (void *) contextInfo;{
if(!error){
NSLog(@"Photo saved to library!");
} else{
NSLog(@"Saving failed :(");
}
}