在 iPhone 中显示图库中的图像

Display images from Gallery in iPhone(在 iPhone 中显示图库中的图像)

本文介绍了在 iPhone 中显示图库中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 iPhone 的新手,现在正处于学习阶段.实际上,我想实现读取存储在 iPhone PHOTO Gallery 中的图像,然后将其显示到我的应用程序中.

I am new in iPhone and in learning phase now a days. Actually i want to implement that i read images stored in my iPhone PHOTO Gallery and then display it onto my application.

我在许多搜索引擎中搜索过,但找不到任何东西.你们都是这里的专业人士.请通过一些代码或教程指导我.

I have searched in many Search Engines but could not find any thing. You all are professionals over here. Please guide me thrrough some code or some tutorial.

非常感谢

推荐答案

编辑

还请查看此问题/答案以及用于从 uiimagepickercontroller 获取图像的方法,因为我之前提到的方法已被弃用.

Also check out this question/answer and the method that is used to get the image from uiimagepickercontroller as the method that i have mentioned earlier is deprecated.

didFinishPickingMediaWithInfo 返回零照片

查看文档 http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html并查看此链接

check out the documentation http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html and check out this link

http://iphone.zcentric.com/2008/08/28/using-a-uiimagepickercontroller/

它有大致相同的示例.

您可以使用这些方法在您的 UIImageView 对象中获取图像

You can use these methods to get the image in you UIImageView object

- (void)selectPhotos
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    picker.delegate = self;
    [self presentViewController:picker animated:YES completion:nil];
    //Deprecated In IOS6[self presentModalViewController:picker animated:YES]; 
    [picker release];
}

- (void)imagePickerController:(UIImagePickerController *)picker
        didFinishPickingImage:(UIImage *)image
                  editingInfo:(NSDictionary *)editingInfo
{
    imageView.image = image;
    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
}

这篇关于在 iPhone 中显示图库中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:在 iPhone 中显示图库中的图像

基础教程推荐