More Motif changes (colour/font stuff)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "wx/icon.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/dcmemory.h"
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
@@ -1003,3 +1004,23 @@ static
|
||||
return ipixmap;
|
||||
}
|
||||
|
||||
// Creates a bitmap with transparent areas drawn in
|
||||
// the given colour.
|
||||
wxBitmap wxCreateMaskedBitmap(wxBitmap& bitmap, wxColour& colour)
|
||||
{
|
||||
wxBitmap newBitmap(bitmap.GetWidth(),
|
||||
bitmap.GetHeight(),
|
||||
bitmap.GetDepth());
|
||||
wxMemoryDC destDC;
|
||||
wxMemoryDC srcDC;
|
||||
srcDC.SelectObject(bitmap);
|
||||
destDC.SelectObject(newBitmap);
|
||||
|
||||
wxBrush brush(colour, wxSOLID);
|
||||
destDC.SetOptimization(FALSE);
|
||||
destDC.SetBackground(brush);
|
||||
destDC.Clear();
|
||||
destDC.Blit(0, 0, bitmap.GetWidth(), bitmap.GetHeight(), & srcDC, 0, 0, wxCOPY, TRUE);
|
||||
|
||||
return newBitmap;
|
||||
}
|
||||
|
Reference in New Issue
Block a user