【发布时间】:2011-01-29 22:22:03
【问题描述】:
如何在 iOS 中从文本创建 png 图像?
【问题讨论】:
如何在 iOS 中从文本创建 png 图像?
【问题讨论】:
如何将视图保存为图像:
UIGraphicsBeginImageContext(myView.bounds.size);
[myView.layer renderInContext:UIGraphicsGetCurrentContext()];
viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
【讨论】:
在斯坦福大学免费 iPhone 编程课程本学期的第一堂课中介绍了它。有video 和 PDF 注释。
基本上,您可以创建一个UIImage 并使用其图形上下文在其中绘制,然后保存图像的PNG 表示形式。
【讨论】: