]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/image.i
Compilation fixes
[wxWidgets.git] / utils / wxPython / src / image.i
index 10050a975b523fb2bc860aaa0136c7596b2012c8..d6095c7a5200f30f8da21135ae112aeccb175d1c 100644 (file)
@@ -32,7 +32,7 @@
 
 class wxImageHandler {
 public:
-    wxImageHandler();
+    // wxImageHandler();    Abstract Base Class
     wxString GetName();
     wxString GetExtension();
     long GetType();
@@ -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);
         }
     }