我正在寻找一种方法,允许我的iPhone应用程序的用户将标签放置在图像上方,并将最终结果保存到新图像中。
我已经尝试过环顾四周,但到目前为止,我还不确定100%应该如何开始实现此功能,或者这是否是执行类似操作的正确方法。
谢谢你。
一旦您的代码检测到用户输入了所需的图像标题,请使用以下代码段:
AppDelegate* appDelegate = ( AppDelegate * ) [UIApplication sharedApplication].delegate;
UIGraphicsBeginImageContext(appDelegate.window.bounds.size);
[appDelegate.window.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData * data = UIImagePNGRepresentation(image);
// Save the data object to the the file.
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句