分割 CG 图像
在iOS 4.0及更高版本中,有没有一种方法可以分割CGImage而不将整个图像加载到内存中?我试图做的是 * 以编程方式 * 分割图像以在使用大图像的 CATiledLayer 应用程序中使用,但我不想占用加载完整图像所涉及的内存。
另外,有没有办法以特定分辨率加载该(或任何)片段,因此,如果我们缩小图像,我们可以以低细节水平加载该图块,从而节省内存。
谢谢! -马特
In iOS 4.0 and later is there a way to segment a CGImage without loading the entire image into memory? What I am attempting to do is * programmatically* segment an image for use in a CATiledLayer application using large images, but I don't want to take up the memory involved in loading the full image.
Also, is there a way to load that (or any) segment at a particular resolution, so if we are zoomed out from the image we can load that tile at a low level of detail, thus saving memory.
Thanks!
-Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须将整个图像加载到内存中才能对其进行分段。如果您有兴趣,我可以给您一些代码来执行此操作。
You'll have to load the whole image in memory in order to segment it. If you're interested I can give you some code to do so.