X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1dec68aa52ae5434af33dbac001a5b48d341b100..85bc0351f76f6d3f00460a167fc108b900e0725c:/utils/wxPython/src/image.i diff --git a/utils/wxPython/src/image.i b/utils/wxPython/src/image.i index 039a5d9cc9..d6095c7a52 100644 --- a/utils/wxPython/src/image.i +++ b/utils/wxPython/src/image.i @@ -82,6 +82,12 @@ public: wxPCXHandler(); }; +class wxTIFFHandler : public wxImageHandler { +public: + wxTIFFHandler(); +}; + + //--------------------------------------------------------------------------- class wxImage { @@ -110,6 +116,8 @@ public: int GetWidth(); int GetHeight(); + wxImage GetSubImage(const wxRect& rect); + //unsigned char *GetData(); //void SetData( unsigned char *data ); @@ -127,7 +135,10 @@ public: PyErr_SetString(PyExc_TypeError, "Expected string object"); return /* NULL */ ; } - dataPtr = (unsigned char*)PyString_AsString(data); + + size_t len = self->GetWidth() * self->GetHeight() * 3; + dataPtr = new unsigned char[len]; + memcpy(dataPtr, PyString_AsString(data), len); self->SetData(dataPtr); } }