]> git.saurik.com Git - wxWidgets.git/commitdiff
Since Scintilla uses XMP internally which doesn't support alpha, check
authorRobin Dunn <robin@alldunn.com>
Thu, 26 May 2005 18:07:43 +0000 (18:07 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 26 May 2005 18:07:43 +0000 (18:07 +0000)
if the images have alpha and convert to a mask.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34351 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/src/stc/gen_iface.py
contrib/src/stc/stc.cpp
src/stc/gen_iface.py
src/stc/stc.cpp

index 9a6c18820040dde28e84dfae1f9e2302e62da976..4e0afbb12919223ce91886da00d085fc8315d8bc 100644 (file)
@@ -203,6 +203,8 @@ methodOverrideMap = {
         // convert bmp to a xpm in a string
         wxMemoryOutputStream strm;
         wxImage img = bmp.ConvertToImage();
+        if (img.HasAlpha())
+            img.ConvertAlphaToMask();
         img.SaveFile(strm, wxBITMAP_TYPE_XPM);
         size_t len = strm.GetSize();
         char* buff = new char[len+1];
@@ -299,6 +301,8 @@ methodOverrideMap = {
         // convert bmp to a xpm in a string
         wxMemoryOutputStream strm;
         wxImage img = bmp.ConvertToImage();
+        if (img.HasAlpha())
+            img.ConvertAlphaToMask();
         img.SaveFile(strm, wxBITMAP_TYPE_XPM);
         size_t len = strm.GetSize();
         char* buff = new char[len+1];
index 86a9690efb7ffcfe82919a28c1cc80498690c6a8..6f580d79414b02969f0caf3c7c88e6901c56fa24 100644 (file)
@@ -517,6 +517,8 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
         // convert bmp to a xpm in a string
         wxMemoryOutputStream strm;
         wxImage img = bmp.ConvertToImage();
+        if (img.HasAlpha())
+            img.ConvertAlphaToMask();
         img.SaveFile(strm, wxBITMAP_TYPE_XPM);
         size_t len = strm.GetSize();
         char* buff = new char[len+1];
@@ -896,6 +898,8 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
         // convert bmp to a xpm in a string
         wxMemoryOutputStream strm;
         wxImage img = bmp.ConvertToImage();
+        if (img.HasAlpha())
+            img.ConvertAlphaToMask();
         img.SaveFile(strm, wxBITMAP_TYPE_XPM);
         size_t len = strm.GetSize();
         char* buff = new char[len+1];
index 9a6c18820040dde28e84dfae1f9e2302e62da976..4e0afbb12919223ce91886da00d085fc8315d8bc 100644 (file)
@@ -203,6 +203,8 @@ methodOverrideMap = {
         // convert bmp to a xpm in a string
         wxMemoryOutputStream strm;
         wxImage img = bmp.ConvertToImage();
+        if (img.HasAlpha())
+            img.ConvertAlphaToMask();
         img.SaveFile(strm, wxBITMAP_TYPE_XPM);
         size_t len = strm.GetSize();
         char* buff = new char[len+1];
@@ -299,6 +301,8 @@ methodOverrideMap = {
         // convert bmp to a xpm in a string
         wxMemoryOutputStream strm;
         wxImage img = bmp.ConvertToImage();
+        if (img.HasAlpha())
+            img.ConvertAlphaToMask();
         img.SaveFile(strm, wxBITMAP_TYPE_XPM);
         size_t len = strm.GetSize();
         char* buff = new char[len+1];
index 86a9690efb7ffcfe82919a28c1cc80498690c6a8..6f580d79414b02969f0caf3c7c88e6901c56fa24 100644 (file)
@@ -517,6 +517,8 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
         // convert bmp to a xpm in a string
         wxMemoryOutputStream strm;
         wxImage img = bmp.ConvertToImage();
+        if (img.HasAlpha())
+            img.ConvertAlphaToMask();
         img.SaveFile(strm, wxBITMAP_TYPE_XPM);
         size_t len = strm.GetSize();
         char* buff = new char[len+1];
@@ -896,6 +898,8 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
         // convert bmp to a xpm in a string
         wxMemoryOutputStream strm;
         wxImage img = bmp.ConvertToImage();
+        if (img.HasAlpha())
+            img.ConvertAlphaToMask();
         img.SaveFile(strm, wxBITMAP_TYPE_XPM);
         size_t len = strm.GetSize();
         char* buff = new char[len+1];