gpt4 book ai didi

iPhone - 将当前 View 保存为图像

转载 作者:行者123 更新时间:2023-12-03 18:17:46 26 4
gpt4 key购买 nike

如何将当前 View 作为图像从我的应用程序保存到相机胶卷?可能吗?

谢谢。

最佳答案

找到了解决方案。可能会帮助某人。要将当前 View 另存为图像,请执行以下操作

UIGraphicsBeginImageContext(pictureView.bounds.size); 
                

[pictureView.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);

关于iPhone - 将当前 View 保存为图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/746421/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com