+ wxImage GetSubImage(const wxRect& rect);
+
+ //unsigned char *GetData();
+ //void SetData( unsigned char *data );
+
+ %addmethods {
+ PyObject* GetData() {
+ unsigned char* data = self->GetData();
+ int len = self->GetWidth() * self->GetHeight() * 3;
+ return PyString_FromStringAndSize((char*)data, len);
+ }
+
+ void SetData(PyObject* data) {
+ unsigned char* dataPtr;
+
+ if (! PyString_Check(data)) {
+ PyErr_SetString(PyExc_TypeError, "Expected string object");
+ return /* NULL */ ;
+ }
+
+ size_t len = self->GetWidth() * self->GetHeight() * 3;
+ dataPtr = new unsigned char[len];
+ memcpy(dataPtr, PyString_AsString(data), len);
+ self->SetData(dataPtr);
+ }
+ }