[wxPython] wxBitmapFromBits

I'm trying to use the wxBitmapFromBits() function, but am having no luck.
What exactly does this function expect for arguments? I thought (for some
reason) that it would take a string containing XBM data as the first
argument, then width, height, depth, but I get a garbage bitmap (no crashes,
though).

I'm generating my XBM data from PIL.

···

--
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308

I'm trying to use the wxBitmapFromBits() function, but am having no luck.
What exactly does this function expect for arguments? I thought (for some
reason) that it would take a string containing XBM data as the first
argument, then width, height, depth, but I get a garbage bitmap (no

crashes,

though).

It is mapped to this wxBitmap constructor, but I don't know anything else
about it:

wxBitmap(const char bits, int width, int height, int depth = 1)

Creates a bitmap from an array of bits.

You should only use this function for monochrome bitmaps (depth 1) in
portable programs: in this case the bits parameter should contain an XBM
image.

For other bit depths, the behaviour is platform dependent: under Windows,
the data is passed without any changes to the underlying CreateBitmap() API.
Under other platforms, only monochrome bitmaps may be created using this
constructor and wxImage should be used for creating colour bitmaps from
static data.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!