Since Scintilla uses XMP internally which doesn't support alpha, check
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
This commit is contained in:
@@ -203,6 +203,8 @@ methodOverrideMap = {
|
|||||||
// convert bmp to a xpm in a string
|
// convert bmp to a xpm in a string
|
||||||
wxMemoryOutputStream strm;
|
wxMemoryOutputStream strm;
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
|
if (img.HasAlpha())
|
||||||
|
img.ConvertAlphaToMask();
|
||||||
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
||||||
size_t len = strm.GetSize();
|
size_t len = strm.GetSize();
|
||||||
char* buff = new char[len+1];
|
char* buff = new char[len+1];
|
||||||
@@ -299,6 +301,8 @@ methodOverrideMap = {
|
|||||||
// convert bmp to a xpm in a string
|
// convert bmp to a xpm in a string
|
||||||
wxMemoryOutputStream strm;
|
wxMemoryOutputStream strm;
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
|
if (img.HasAlpha())
|
||||||
|
img.ConvertAlphaToMask();
|
||||||
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
||||||
size_t len = strm.GetSize();
|
size_t len = strm.GetSize();
|
||||||
char* buff = new char[len+1];
|
char* buff = new char[len+1];
|
||||||
|
@@ -517,6 +517,8 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
|||||||
// convert bmp to a xpm in a string
|
// convert bmp to a xpm in a string
|
||||||
wxMemoryOutputStream strm;
|
wxMemoryOutputStream strm;
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
|
if (img.HasAlpha())
|
||||||
|
img.ConvertAlphaToMask();
|
||||||
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
||||||
size_t len = strm.GetSize();
|
size_t len = strm.GetSize();
|
||||||
char* buff = new char[len+1];
|
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
|
// convert bmp to a xpm in a string
|
||||||
wxMemoryOutputStream strm;
|
wxMemoryOutputStream strm;
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
|
if (img.HasAlpha())
|
||||||
|
img.ConvertAlphaToMask();
|
||||||
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
||||||
size_t len = strm.GetSize();
|
size_t len = strm.GetSize();
|
||||||
char* buff = new char[len+1];
|
char* buff = new char[len+1];
|
||||||
|
@@ -203,6 +203,8 @@ methodOverrideMap = {
|
|||||||
// convert bmp to a xpm in a string
|
// convert bmp to a xpm in a string
|
||||||
wxMemoryOutputStream strm;
|
wxMemoryOutputStream strm;
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
|
if (img.HasAlpha())
|
||||||
|
img.ConvertAlphaToMask();
|
||||||
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
||||||
size_t len = strm.GetSize();
|
size_t len = strm.GetSize();
|
||||||
char* buff = new char[len+1];
|
char* buff = new char[len+1];
|
||||||
@@ -299,6 +301,8 @@ methodOverrideMap = {
|
|||||||
// convert bmp to a xpm in a string
|
// convert bmp to a xpm in a string
|
||||||
wxMemoryOutputStream strm;
|
wxMemoryOutputStream strm;
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
|
if (img.HasAlpha())
|
||||||
|
img.ConvertAlphaToMask();
|
||||||
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
||||||
size_t len = strm.GetSize();
|
size_t len = strm.GetSize();
|
||||||
char* buff = new char[len+1];
|
char* buff = new char[len+1];
|
||||||
|
@@ -517,6 +517,8 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
|||||||
// convert bmp to a xpm in a string
|
// convert bmp to a xpm in a string
|
||||||
wxMemoryOutputStream strm;
|
wxMemoryOutputStream strm;
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
|
if (img.HasAlpha())
|
||||||
|
img.ConvertAlphaToMask();
|
||||||
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
||||||
size_t len = strm.GetSize();
|
size_t len = strm.GetSize();
|
||||||
char* buff = new char[len+1];
|
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
|
// convert bmp to a xpm in a string
|
||||||
wxMemoryOutputStream strm;
|
wxMemoryOutputStream strm;
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
|
if (img.HasAlpha())
|
||||||
|
img.ConvertAlphaToMask();
|
||||||
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
|
||||||
size_t len = strm.GetSize();
|
size_t len = strm.GetSize();
|
||||||
char* buff = new char[len+1];
|
char* buff = new char[len+1];
|
||||||
|
Reference in New Issue
Block a user