我如何参考我刚刚在iOS中拍摄的图片? [英] How do I reference the picture I just took in iOS?

查看:123
本文介绍了我如何参考我刚刚在iOS中拍摄的图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,允许用户拍照,然后在图片视图中显示。

I'm writing an app that allows the user to take a picture and then shows it in an image view.

我知道我需要写一行代码类似于以下内容: _imageView.image = picker.image; ,但我不确定我需要替换 picker.image 。这就是我现在所拥有的,它给了我一个错误。

I get that I need to write a line of code similar to the following: _imageView.image = picker.image;, but I'm not sure what I need to substitute for picker.image. That is what I currently have and it gives me an error.

基本上,我问的是如何引用刚拍摄的照片?服用后,这张照片在哪里(在记忆中?)?我怎样才能在以后引用它(比如显示和保存那些东西)?

Basically, what I'm asking is how do I reference the picture that was just taken? Where does this picture go (in memory?) after you take it? How can I reference it later (like for displaying and saving and that sort of stuff)?

我已经阅读了官方的Apple文档并查看了一些教程和答案似乎不在其中任何一个。正如我在之前的帖子中提到的,我在解析Apple文档时遇到了很多麻烦,所以对我来说它几乎没用。

I've already read the official Apple documentation and looked at a few tutorials and the answer doesn't seem to be in any of them. As I've mentioned in previous posts, I tend to have a lot of trouble parsing the Apple documentation, so it's been mostly useless for me.

谢谢!

推荐答案

我使用以下委托方法来获取用户从照片选择器视图中选择的任何照片

I use the following delegate method to get whatever picture a user picked from the photo picker view

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    [picker dismissViewControllerAnimated:false completion:nil];
    image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; 

}

这篇关于我如何参考我刚刚在iOS中拍摄的图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆