Tkinter Bitmap Newbie question

Eric Brunel eric_brunel at despammed.com
Tue Mar 15 03:40:30 EST 2005


On Tue, 15 Mar 2005 00:00:57 GMT, Neil Hodgson <nyamatongwe+gravity at gmail.com> wrote:
> Wim Goffin:
>
>> But just to make sure I'm on the right track,
>> - Is XBM the best way to for bitmaps? The ones I saw so far are all black
>> and white. Do they also exist in color?
>
>    XPM is the version of XBM with colour.
>
>> - Is XBM also the best format for glyphs on the Windows platform? Or would
>> 'Images' of a different format be nicer?
>
>    It depends on what you want to do with icons. Do you want users to be
> able to change icons? It is less likely Windows users will have tools
> for manipulating XPM files. The only feature that you are likely to want
> that is not available from XPM is multi-level transparency which is
> available from PNG files.
>
>    My generic advice without additional details of your project is that
> PNG is the best format for icons displayed by your code. Icons used by
> the operating system such as for applications should be in a format
> supported by that OS: Windows prefers ICO files.

XPM, PNG and ICO files are not natively supported by tk/Tkinter. The only natively supported format is GIF, apparently mainly for historical reasons. There are tcl/tk extensions allowing to handle other image formats, but they may be weird to use from Tkinter (never tried them). If you want a portable application or if you just don't want to bother, you'd better use either XBM or GIF files for images.

HTH
-- 
python -c 'print "".join([chr(154 - ord(c)) for c in "U(17zX(%,5.z^5(17l8(%,5.Z*(93-965$l7+-"])'



More information about the Python-list mailing list