[wxPython-users] using wxImage in C++ python extension
Christopher Barker
Chris.Barker at noaa.gov
Mon Aug 14 11:33:24 PDT 2006
Robin Dunn wrote:
> OTOH, if you don't mind an extra data copy then your extension could
> just provide the image data as a string or RGB bytes and then you can
> create the wx.Image from Python using that string and the
> wx.ImageFromData constructor.
Why does that have to create a copy? It looks like the C++
wx.ImageSetData() method is expecting a pointer to the data. Couldn't
the wxPython version pass the pointer through from the buffer object? Or
better yet, from a nd-array (from the numpy array protocol).
I partly ask this because there is a thread on the matplotlib list about
how to make the wx back-end pure Python, rather than having them depend
on the right wx-devel stuff being installed, and after building, being
as version specific as they are. Being able to pass data into a wxImage
(or better yet, a wxBitmap) without copying would be a great help.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the wxpython-users
mailing list