[Tutor] greyscale bitmaps with python

Michael Lange klappnase at freenet.de
Thu Jul 8 22:28:39 CEST 2004


On Thu, 8 Jul 2004 04:24:12 -0700 (PDT)
John Fusco <fusco_john at yahoo.com> wrote:

> I'm looking for a quick and dirty way to display a
> greyscale bitmap from a list of integers.  I don't
> think I can do this with Tkinter.  Any ideas?
> 
> Thanks,
> John
> 

Hi John,

I'm not sure if that is what you need:

<code snippet>
# 7x4 xbm bitmap:
arrow_up = '#define incr_width 7\n#define incr_height 4\nstatic char incr_bits[] = {   0x08, 0x1c, 0x3e, 0x7f};'
self._arrow_up = Tkinter.BitmapImage(data=arrow_up, foreground=button_fg)
self.up = Tkinter.Button(self._bframe, image=self._arrow_up)

The arrow_up string is simply the contents of an xbm Bitmap file opened with a text editor.

Michael


More information about the Tutor mailing list