drawing mono bitmaps now uses correct colours
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -653,9 +653,23 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
|
|||||||
|
|
||||||
wxASSERT_MSG( hbitmap, wxT("bitmap is ok but HBITMAP is NULL?") );
|
wxASSERT_MSG( hbitmap, wxT("bitmap is ok but HBITMAP is NULL?") );
|
||||||
|
|
||||||
|
COLORREF old_textground = ::GetTextColor(GetHdc());
|
||||||
|
COLORREF old_background = ::GetBkColor(GetHdc());
|
||||||
|
if (m_textForegroundColour.Ok())
|
||||||
|
{
|
||||||
|
::SetTextColor(GetHdc(), m_textForegroundColour.GetPixel() );
|
||||||
|
}
|
||||||
|
if (m_textBackgroundColour.Ok())
|
||||||
|
{
|
||||||
|
::SetBkColor(GetHdc(), m_textBackgroundColour.GetPixel() );
|
||||||
|
}
|
||||||
|
|
||||||
::SelectObject( memdc, hbitmap );
|
::SelectObject( memdc, hbitmap );
|
||||||
::BitBlt( cdc, x, y, bmp.GetWidth(), bmp.GetHeight(), memdc, 0, 0, SRCCOPY);
|
::BitBlt( cdc, x, y, bmp.GetWidth(), bmp.GetHeight(), memdc, 0, 0, SRCCOPY);
|
||||||
::DeleteDC( memdc );
|
::DeleteDC( memdc );
|
||||||
|
|
||||||
|
::SetTextColor(GetHdc(), old_textground);
|
||||||
|
::SetBkColor(GetHdc(), old_background);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1232,8 +1246,6 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
|||||||
wxCoord xsrc1 = xsrc;
|
wxCoord xsrc1 = xsrc;
|
||||||
wxCoord ysrc1 = ysrc;
|
wxCoord ysrc1 = ysrc;
|
||||||
|
|
||||||
// Chris Breeze 18/5/98: use text foreground/background colours
|
|
||||||
// when blitting from 1-bit bitmaps
|
|
||||||
COLORREF old_textground = ::GetTextColor(GetHdc());
|
COLORREF old_textground = ::GetTextColor(GetHdc());
|
||||||
COLORREF old_background = ::GetBkColor(GetHdc());
|
COLORREF old_background = ::GetBkColor(GetHdc());
|
||||||
if (m_textForegroundColour.Ok())
|
if (m_textForegroundColour.Ok())
|
||||||
|
Reference in New Issue
Block a user