将正常的PNG转换为iPhone优化格式 [英] Converting a normal PNG to iPhone Optimized format

查看:86
本文介绍了将正常的PNG转换为iPhone优化格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iPhone应用程序,可以从互联网上下载图片并保存以供日后显示。

I have an iPhone application that downloads images from the internet and saves them for display later.

用户可以从UITableView中选择要查看的图片,

The user can select the images to view from a UITableView, the table view has custom cells which display thumbnails of the original images in varying sizes.

当首次下载大图片时,缩放为缩略图大小,缩略图使用UIImagePNGRepresentation进行保存。

When the large image is first downloaded it is scaled to thumbnail size and the thumbnail is saved using UIImagePNGRepresentation.

我想做的是将优化的iPhone PNG格式的缩略图保存。我该怎么办?它是否发生奇怪只是通过加载原始的大图像到内存中并保存?在保存之前,我必须对缩略图进行任何进一步处理吗?

What I would like to do is save the thumbnail in the optimized iPhone PNG format. How can I do that? does it happen magically just by loading the original large image into memory and saving it? Do I have to do any further processing on the thumbnail before saving?

推荐答案

很可能是UIImagePNGRepresentation不创建图像它们是非共形PNG,并且不能被任何其他东西读取。如果他们的API生成的PNGs无法读取,我认为它会记录下来,任何人从手机上传PNGs会注意到他们没有工作。

Chances are the UIImagePNGRepresentation does not create the images, as they are non-comformant PNGs, and can't be read by anything else. If they API generated PNGs that could not be read I think it would document that, and anyone who uploads PNGs from the phone would notice that they did not work.

是有用的,但大多数优化的PNG是UI的一部分,其中优化是作为构建过程的一部分。执行优化的成本很可能会抵消您从中获得的任何收益。

The optimization is useful, but most of the optimized PNGs are part of the UI where the optimization is done as part of the build process. Chances are the cost of performing the optimization will offset any gains you get from it.

这篇关于将正常的PNG转换为iPhone优化格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆