Added ImageFromDataWithAlpha ctor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -106,6 +106,24 @@ public:
|
|||||||
memcpy(copy, data, width*height*3);
|
memcpy(copy, data, width*height*3);
|
||||||
return new wxImage(width, height, copy, false);
|
return new wxImage(width, height, copy, false);
|
||||||
}
|
}
|
||||||
|
%name(ImageFromDataWithAlpha) wxImage(int width, int height,
|
||||||
|
unsigned char* data, unsigned char* alpha) {
|
||||||
|
// Copy the source data so the wxImage can clean it up later
|
||||||
|
unsigned char* dcopy = (unsigned char*)malloc(width*height*3);
|
||||||
|
if (dcopy == NULL) {
|
||||||
|
PyErr_NoMemory();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
memcpy(dcopy, data, width*height*3);
|
||||||
|
unsigned char* acopy = (unsigned char*)malloc(width*height);
|
||||||
|
if (acopy == NULL) {
|
||||||
|
PyErr_NoMemory();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
memcpy(acopy, alpha, width*height);
|
||||||
|
|
||||||
|
return new wxImage(width, height, dcopy, acopy, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Create( int width, int height );
|
void Create( int width, int height );
|
||||||
|
Reference in New Issue
Block a user