<h2>wxPython中的img2py的使用方法简介</h2>
<div id="seaprince"><!--CONTENTSTART-->
在查看wxpython自带的demo的源代码的时候总是有一点特别奇怪,它那里有一个文件是images.py,它里有一句是对一个解释是这样的:<br />
This file was generated by C:\PROJECTS\wx\wxPython\demo\encode_bitmaps.py<br />
打开这个encode_bitmaps.py文件一看,发现居然是对wxpython.tools里一个叫img2py的例程的调用。<br />
原来这个img2py是将图像转为以py文件存储的程序哦。终于明白了。<br />
于是退出python的环境,到命令行下运行img2py看看。<br />
果然有一大堆的参数。<br />
下面是帮助的东东哦。<br />
[myphp]<br />
img2py.py -- Convert an image to PNG format and embed it in a Python<br />
module with appropriate code so it can be loaded into<br />
a program at runtime. The benefit is that since it is<br />
Python source code it can be delivered as a .pyc or<br />
'compiled' into the program using freeze, py2exe, etc.<br />
<br />
Usage:<br />
<br />
img2py.py [options] image_file python_file<br />
<br />
Options:<br />
<br />
-m |