I think there's a bug with wx.lib.wxcairo.ImageSurfaceFromBitmap; it
doesn't work for 24bpp images.
A simple way to show the bug is to open the Cairo demo and change line 103 from
bmp = wx.Bitmap(opj('bitmaps/toucan.png'))
to
bmp = wx.Bitmap(opj('bitmaps/splash.png'))
(or any other 24bpp image)
This is the exception thrown:
Traceback (most recent call last):
File "C:\Documents and Settings\Conrado\Dados de
aplicativos\wxPyDemo\modified\Cairo.py", line 31, in OnPaint
self.Render(dc)
File "C:\Documents and Settings\Conrado\Dados de
aplicativos\wxPyDemo\modified\Cairo.py", line 104, in Render
img = wx.lib.wxcairo.ImageSurfaceFromBitmap(bmp)
File "C:\Python26\Lib\site-packages\wx-2.8-msw-unicode\wx\lib\wxcairo.py",
line 216, in ImageSurfaceFromBitmap
bitmap.CopyToBuffer(surface.get_data(), fmt, stride)
File "C:\Python26\Lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py",
line 765, in CopyToBuffer
return _gdi_.Bitmap_CopyToBuffer(*args, **kwargs)
RuntimeError: Failed to gain raw access to bitmap data.