wxPython 2.6.1.0, linux & windows Python 2.4
I'm putting this here because gmane thinks I'm top-posting
Hi, I've got a C++ extension that reads an image and returns wxImage.
On Windows, I'm using a patched version of swig, and when I try my
code, my wxImage shows up as a PySwigObj and I can't do anything with
it like call SaveFile.
On Linux when I try to use it I get:
img = r.GetTile(0,0,0,0)
img
'_20f23108_p_wxImage'
type(img)
<type 'str'>
img.SaveFile("out.png", wx.BITMAP_TYPE_PNG)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'str' object has no attribute 'SaveFile'
At one time I had it working with functions that returned wxImage*
(a pointer instead of using the reference-counted assignment return.)
How can I get it working with plain old wxImage?
My .i file is below
Thanks!
-Jim
---------- TileCache.i ---------------------
%{
#include "wx/wxPython/wxPython.h"
#include "imaging/big/tileCache.h"
%}
%import typemaps.i
%import my_typemaps.i
%pragma(python) code = "import wx"
class TileCache: public TileFilter
{
public:
TileCache();
void SetCacheSize(int size);
virtual wxImage GetTile(unsigned int tilex, unsigned int tiley, unsigned int
tilez = 0, unsigned int reduction = 0);
};
%init %{
//wxClassInfo::CleanUpClasses();
//wxClassInfo::InitializeClasses();
%}
/* end of tileCache.i */