[wxPython-users] Does wx support DIB bitmap?
甜瓜
littlesweetmelon at gmail.com
Sun Jun 3 19:38:57 PDT 2007
I encounter a big problem in drawing bitmap to a wx.Window. The bitmap
data is not in the form of RGB-8byte. The pixel is 64K color which
Rmax, Gmax, Bmax == (31, 63, 31). For this pixel format, I can easily
create a DIB by using pure Win32 API and then Bitblt to a window area.
However, it seems that wx does not support DIB and it does not give
user a opportunity to setup pixel format (eg: Red bitshift, etc.).
Maybe DIB is only used by MS Window, while other platforms use
different methods to deal with bitmap rendering. So, what is the best
way to draw a bitmap from buffer platform-independently?
The required rendering speed is about 15-20 fps for the area
(1024x768). The additional buffer-copying is the most I concerned. Is
this problem the bottle-neck of my rendering program in python? How to
suppress this operation? Eg: the bitmap data is not at the beginning
of the buffer, but in the middle:
wx.BitmapForBuffer(w, h, buf[start:end] ) # @_@ may be a big copy...
Thank you.
--
ShenLei
More information about the wxpython-users
mailing list