- m_graphicContext->DrawBitmap( bmp, x , y , bmp.GetWidth() , bmp.GetHeight() );
+ int w = bmp.GetWidth();
+ int h = bmp.GetHeight();
+ if ( bmp.GetDepth() == 1 )
+ {
+ m_graphicContext->SetPen(*wxTRANSPARENT_PEN);
+ m_graphicContext->SetBrush( wxBrush( m_textBackgroundColour , wxSOLID ) );
+ m_graphicContext->DrawRectangle( x, y, w, h );
+ m_graphicContext->SetBrush( wxBrush( m_textForegroundColour , wxSOLID ) );
+ m_graphicContext->DrawBitmap( bmp, x, y, w, h );
+ m_graphicContext->SetBrush( m_graphicContext->CreateBrush(m_brush));
+ m_graphicContext->SetPen( m_graphicContext->CreatePen(m_pen));
+ }
+ else // not a monochrome bitmap, handle it normally
+ {
+ // make a copy in case we need to remove its mask, if we don't modify
+ // it the copy is cheap as bitmaps are reference-counted
+ wxBitmap bmpCopy(bmp);
+ if ( !useMask && bmp.GetMask() )
+ bmpCopy.SetMask(NULL);
+
+ m_graphicContext->DrawBitmap( bmpCopy, x, y, w, h );
+ }