iPhone上的图像编辑
答
UIImagePickerController应该做的伎俩。
UIImagePickerController *picker = [UIImagePickerController new];
picker.delegate = self;
picker.allowsEditing = YES;
[yourViewController presentModalViewController:picker];
然后,我们需要实现的委托方法:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
}
答
@denizen [yourViewController presentModalViewController:picker];
需要动画:BOOL。
像:[yourViewController presentModalViewController:picker animated:YES];
答
你也可以看看SSPhotoCropperViewController。这是一个自定义视图控制器,提供了一个简单,可配置和易于使用的用户界面,用于在iPhone & iPod Touch应用中裁剪和缩放照片。
对于从照片库中选取照片,UIImagePickerController表现不错。但是,您不能将其用于从其他来源获得的照片,例如Flickr,FB等。
以下是SSPhotoCropperViewController的tutorial和source code on GitHub。
使用UIImagePickerController我们可以编辑图像吗? – PgmFreek 2010-11-08 04:34:32
通过设置picker.allowsEditing,控制器会自动让用户裁剪并缩放,然后再返回给您。 – denizen 2010-11-08 04:37:22
如何在选择器模式视图中将“选择”按钮名称更改为“完成”? – PgmFreek 2010-11-08 06:22:14