如何在uiimagepicker中了解图像采集?

时间:2011-03-24 06:02:11

标签: iphone objective-c xcode background uiimagepickercontroller

如何了解uiimagepicker中的图像拾取以及如何修改拾取图像或如何在图像拾取后调用?以及如何使用xcode for iphone将拾取图像作为下一个视图的背景图像?

2 个答案:

答案 0 :(得分:2)

您可以参考UIImagePickercontroller并使用UIImagePickerController的委托方法UIImagePickerDelegate

     - (void)imagePickerController:(UIImagePickerController  *)picker didFinishPickingMediaWithInfo:(NSDictionary  *)info
{
// Get the image picked by the image picker
UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
//Do something
}

答案 1 :(得分:1)

使用UIImagePickerController的委托方法:

- (void)imagePickerController:(UIImagePickerController *)pickerdidFinishPickingMediaWithInfo:(NSDictionary *)info {

   // Get the image picked by the image picker
   UIImage *image :[info objectForKey:@"UIImagePickerControllerOriginalImage"] ;
   //Do something
   [picker dismissModalViewControllerAnimated:YES];
}

或者我相信此链接可能对您有所帮助:

http://www.icodeblog.com/2009/07/28/getting-images-from-the-iphone-photo-library-or-camera-using-uiimagepickercontroller/