Use the wxBitmap implementation from wxX11

in wxMotif; solves various bugs related to wxMask
handling (and effectively adds a lot of wxMask
functionality previously missing).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-04-09 16:44:27 +00:00
parent 507db85d59
commit aae0472bf3
16 changed files with 80 additions and 1486 deletions

View File

@@ -1235,3 +1235,30 @@ XmString wxStringToXmString( const char* str )
{
return XmStringCreateLtoR((char *)str, XmSTRING_DEFAULT_CHARSET);
}
// ----------------------------------------------------------------------------
// wxBitmap utility functions
// ----------------------------------------------------------------------------
// Creates a bitmap with transparent areas drawn in
// the given colour.
wxBitmap wxCreateMaskedBitmap(const 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;
}