Restrict the usage of undocumented wxBitmap ctor to wxWidgets > 3.1.0

Fix build for wxWidgets 3.0
This commit is contained in:
wangqr 2020-02-23 00:42:45 -05:00
parent 6f546951b4
commit 5f235ff459
1 changed files with 10 additions and 2 deletions

View File

@ -22,9 +22,17 @@
wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) {
wxMemoryInputStream mem(buff, size);
#if wxCHECK_VERSION(3, 1, 0)
// Since wxWidgets 3.1.0, there is an undocumented third parameter in the ctor of wxBitmap from wxImage
// This "scale" parameter sets the logical scale factor of the created wxBitmap
if (dir != wxLayout_RightToLeft)
return wxBitmap(wxImage(mem), -1, scale);
return wxBitmap(wxImage(mem).Mirror(), -1, scale);
return wxBitmap(wxImage(mem), wxBITMAP_SCREEN_DEPTH, scale);
return wxBitmap(wxImage(mem).Mirror(), wxBITMAP_SCREEN_DEPTH, scale);
if (dir != wxLayout_RightToLeft)
return wxBitmap(wxImage(mem));
return wxBitmap(wxImage(mem).Mirror());
wxIcon libresrc_geticon(const unsigned char *buff, size_t size) {