如何将图像保存到相机胶卷? [英] How can I save an image to the camera roll?
本文介绍了如何将图像保存到相机胶卷?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新的Xcode(使用4.3),我不知道如何保存图像到设备的相机胶卷。我迄今为止所做的所有的设置了一个IBAction的按钮来保存图像。
I am new to Xcode (using 4.3) and am not sure how to save an image to the device's camera roll. All that I have done so far is set up an IBAction for the button to save the image. What library method or function can I use to save an image to the user's camera roll?
推荐答案
您可以使用 UIImageWriteToSavedPhotosAlbum()
函数。
You use the UIImageWriteToSavedPhotosAlbum()
function.
//Let's say the image you want to save is in a UIImage called "imageToBeSaved"
UIImageWriteToSavedPhotosAlbum(imageToBeSaved, nil, nil, nil);
编辑:
//ViewController.m
- (IBAction)onClickSavePhoto:(id)sender{
UIImageWriteToSavedPhotosAlbum(imageToBeSaved, nil, nil, nil);
}
这篇关于如何将图像保存到相机胶卷?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文