Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 iOS 中将 CGImageRef 保存为 png 或 jpeg 文件的最佳方法是什么?
对于一般的可可应用程序(不使用 UIkit),请参阅:将 CGImageRef保存到 png 文件?但这似乎太长太笨重了。
使用 UIKit,代码变成了一个简单的 3 行代码:
UIImage *uiImage = [UIImage imageWithCGImage:cgImage]; NSData *jpgData = UIImageJPEGRepresentation(uiImage, 0.9f); [jpgData writeToFile:path atomically:NO];
如何在 XTemplate 中执行特定次数的循环
以下不起作用
<tpl for="5"> ... </tpl>
问候, kkris1983