]>
Commit | Line | Data |
---|---|---|
d14a1e28 RD |
1 | #---------------------------------------------------------------------- |
2 | # Name: wxPython.tools.img2xpm | |
3 | # Purpose: Convert an image to XPM format | |
4 | # | |
5 | # Author: Robin Dunn | |
6 | # | |
7 | # RCS-ID: $Id$ | |
8 | # Copyright: (c) 2002 by Total Control Software | |
9 | # Licence: wxWindows license | |
10 | #---------------------------------------------------------------------- | |
d4b73b1b RD |
11 | # 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) |
12 | # | |
13 | # o V2.5 compatability update | |
14 | # | |
d14a1e28 RD |
15 | |
16 | """ | |
99109c0f | 17 | img2xpm.py -- convert several image formats to XPM. |
d14a1e28 RD |
18 | |
19 | Usage: | |
20 | ||
21 | img2xpm.py [options] image_files... | |
22 | ||
23 | Options: | |
24 | ||
25 | -o <dir> The directory to place the .xpm file(s), defaults to | |
26 | the current directory. | |
27 | ||
28 | -m <#rrggbb> If the original image has a mask or transparency defined | |
29 | it will be used by default. You can use this option to | |
30 | override the default or provide a new mask by specifying | |
31 | a colour in the image to mark as transparent. | |
32 | ||
33 | -n <name> A filename to write the .xpm data to. Defaults to the | |
34 | basename of the image file + '.xpm' This option overrides | |
35 | the -o option. | |
36 | """ | |
37 | ||
d4b73b1b | 38 | import sys |
d4b73b1b | 39 | import wx |
d4b73b1b | 40 | import img2img |
d14a1e28 | 41 | |
2240b1aa | 42 | app = None |
d14a1e28 RD |
43 | def main(): |
44 | # some bitmap related things need to have a wxApp initialized... | |
d4b73b1b | 45 | if wx.GetApp() is None: |
2240b1aa | 46 | global app |
d4b73b1b RD |
47 | app = wx.PySimpleApp() |
48 | img2img.main(sys.argv[1:], wx.BITMAP_TYPE_XPM, ".xpm", __doc__) | |
d14a1e28 RD |
49 | |
50 | ||
51 | if __name__ == '__main__': | |
52 | main() | |
53 | ||
1fded56b | 54 | |
1fded56b | 55 |