I am trying to transfer an image from extension dll to
wx.Image. I was able to tranfer using python string
data type (make a copy first) and use wx.Image.SetData
method to copy the image again to an wx.Image.
However, attempts to transfer using python buffer data
type (no copying) and use wx.Image.SetDataBuffer
method have always result in an exception and exit of
program. attached is the dll and python code. Anyone
know why?
Thanks,
Fuming Wang
extension code:
int length = 30000;
static PyObject *
spam_GetImageData(PyObject *self)
{
int i, width;
I forgot to mention. This was run on Windows2000 with
python 2.3 and wxPython 2.4.1.2. Extension is
compiled with VC++ 6.0 and disutil.py
Thanks,
Fuming
···
--- Fuming Wang <fumingw@yahoo.com> wrote:
Hi,
I am trying to transfer an image from extension dll
to
wx.Image. I was able to tranfer using python string
data type (make a copy first) and use
wx.Image.SetData
method to copy the image again to an wx.Image.
However, attempts to transfer using python buffer
data
type (no copying) and use wx.Image.SetDataBuffer
method have always result in an exception and exit
of
program. attached is the dll and python code.
Anyone
know why?
Thanks,
Fuming Wang
extension code:
int length = 30000;
static PyObject *
spam_GetImageData(PyObject *self)
{
int i, width;
I am trying to transfer an image from extension dll to
wx.Image. I was able to tranfer using python string
data type (make a copy first) and use wx.Image.SetData
method to copy the image again to an wx.Image. However, attempts to transfer using python buffer data
type (no copying) and use wx.Image.SetDataBuffer
method have always result in an exception and exit of
program. attached is the dll and python code. Anyone
know why?
There are a couple bugs in SetDataBuffer, I'll check in a fix shortly.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!