]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/image.i
Removed deprecation warnings in OGL and Gizmos
[wxWidgets.git] / wxPython / src / image.i
index 84d1c7c5f0a59180e04e926fc0c29779e159b286..7f125f11bcd519bf86f7487a714b0249c68885f0 100644 (file)
@@ -179,6 +179,21 @@ public:
             return PyString_FromStringAndSize((char*)data, len);
         }
 
+        void SetDataBuffer(PyObject* data) {
+            unsigned char* buffer;
+            int size;
+
+            if (!PyArg_Parse(data, "w#", &buffer, &size))
+                return;
+
+            if (size != self->GetWidth() * self->GetHeight() * 3) {
+                PyErr_SetString(PyExc_TypeError, "Incorrect buffer size");
+                return;
+            }
+
+            self->SetData(buffer);
+        }
+
         void SetData(PyObject* data) {
             unsigned char* dataPtr;