products ::: library ::: search ::: daily Python-URL!

The Canvas Bitmap Item

Back   Next   

 Chapter 15. The Canvas Bitmap Item

Table of Contents

The bitmap item draws a bitmap on the canvas.

    item = canvas.create_bitmap(100, 100, bitmap="info", foreground="gold")

You can use either a builtin bitmap, such as "hourglass", "info", "question", or "warning", or load a bitmap from an XBM file.

Figure 15-1. Bitmap Example

For more flexible image support, use create_image instead (with a Tkinter BitmapImage instance, or an instance of the corresponding Python Imaging Library class).


The following bitmaps are available on all platforms: "error", "gray75", "gray50", "gray25", "gray12", "hourglass", "info", "questhead", "question", and "warning".

The following additional bitmaps are available on the Macintosh only: "document", "stationery", "edition", "application", "accessory", "folder", "pfolder", "trash", "floppy", "ramdisk", "cdrom", "preferences", "querydoc", "stop", "note", and "caution".

You can also load the bitmap from an XBM file. Just prefix the filename with an at-sign, for example "@sample.xbm".

Back   Next