zoukankan      html  css  js  c++  java
  • Viewing iPhoneOptimized PNGs 不及格的程序员

    Technical Q&A QA1681

    Viewing iPhone-Optimized PNGs

    Q:  When I build my iPhone OS application, Xcode optimizes the PNG files within my application's bundle, meaning that Preview can't display them. How can I view these optimized files?

    A: When I build my iPhone OS application, Xcode optimizes the PNG files within my application's bundle, meaning that Preview can't display them. How can I view these optimized files?

    This optimization is done by the pngcrush tool, which you can find in /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush (assuming you installed the iPhone SDK in the standard place). In iPhone SDK 3.2 and later, the pngcrush tool supports a command line option, -revert-iphone-optimizations, that undoes the optimizations done during the Xcode build process. So, to view an optimized PNG file, you should first undo the optimization and then open it with Preview.

    Listing 1 shows how you can use the pngcrush tool to convert an iPhone-optimized PNG file (Local.png) to a standard PNG file (Local-standard.png).

    Listing 1  Undoing iPhone PNG optimization

    $ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush \ -revert-iphone-optimizations -q Local.png Local-standard.png
     

    批量将优化后的PNG文件转换为正常可预览的PNG文件:

    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -revert-iphone-optimizations -d outdir *.png

  • 相关阅读:
    『翻译』Android USB Host
    转--HC05-两个蓝牙模块间的通信
    情人节来了,教你个用 Python 表白的技巧
    最全的 pip 使用指南,50% 你可能没用过
    用 Sphinx 搭建博客时,如何自定义插件?
    一个 Vim 重度用户总结的 vim 超全指南
    每周分享五个 PyCharm 使用技巧(六)
    云计算与虚拟化入门通识
    Python静态方法,其实暗藏玄机
    每周分享五个 PyCharm 使用技巧(五)
  • 原文地址:https://www.cnblogs.com/ioriwellings/p/2409265.html
Copyright © 2011-2022 走看看