Home | Trees | Index | Help |
|
---|
Package wx :: Package tools :: Module img2py |
|
Usage:
img2py.py [options] image_file python_file
Options:
- -m <#rrggbb> If the original image has a mask or transparency defined
- it will be used by default. You can use this option to override the default or provide a new mask by specifying a colour in the image to mark as transparent.
-n <name> Normally generic names (getBitmap, etc.) are used for the image access functions. If you use this option you can specify a name that should be used to customize the access fucntions, (getNameBitmap, etc.) -c Maintain a catalog of names that can be used to reference images. Catalog can be accessed via catalog and index attributes of the module. If the -n <name> option is specified then <name> is used for the catalog key and index value, otherwise the filename without any path or extension is used as the key. -a This flag specifies that the python_file should be appended to instead of overwritten. This in combination with -n will allow you to put multiple images in one Python source file. -u Don't use compression. Leaves the data uncompressed. -i Also output a function to return the image as a wxIcon.
You can also import this module from your Python scripts, and use its img2py() function. See its docstring for more info.
Function Summary | |
---|---|
crunch_data(data,
compressed)
| |
Converts an image file to a data structure written in a Python file --image_file: string; the path of the source image file --python_file: string; the path of the destination python file --other arguments: they are equivalent to the command-line arguments | |
main(args)
|
Variable Summary | |
---|---|
NoneType |
app = None |
bool |
DEFAULT_APPEND = False
|
bool |
DEFAULT_CATALOG = False
|
bool |
DEFAULT_COMPRESSED = True
|
bool |
DEFAULT_ICON = False
|
str |
DEFAULT_IMGNAME = ''
|
NoneType |
DEFAULT_MASKCLR = None |
SRE_Pattern |
indexPattern = \s*index.append\('(.+)'\)\s*
|
Function Details |
---|
img2py(image_file, python_file, append=False, compressed=True, maskClr=None, imgName='', icon=False, catalog=False)Converts an image file to a data structure written in a Python file --image_file: string; the path of the source image file --python_file: string; the path of the destination python file --other arguments: they are equivalent to the command-line arguments |
Variable Details |
---|
app
|
DEFAULT_APPEND
|
DEFAULT_CATALOG
|
DEFAULT_COMPRESSED
|
DEFAULT_ICON
|
DEFAULT_IMGNAME
|
DEFAULT_MASKCLR
|
indexPattern
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:11:19 2007 | http://epydoc.sf.net |