- m_selected = bitmap;
- if (m_selected.Ok())
- {
- m_window = m_selected.GetPixmap();
- SetUpDC();
- }
- else
- {
- m_ok = FALSE;
- m_window = NULL;
- };
-};
-
-void wxMemoryDC::GetSize( int *width, int *height )
+ Destroy();
+ m_selected = bitmap;
+ if (m_selected.Ok())
+ {
+ m_window = m_selected.GetPixmap();
+
+ m_selected.PurgeOtherRepresentations(wxBitmap::Pixmap);
+
+ m_isMemDC = true;
+
+ SetUpDC();
+ }
+ else
+ {
+ m_ok = false;
+ m_window = (GdkWindow *) NULL;
+ }
+}
+
+void wxMemoryDC::SetPen( const wxPen& penOrig )
+{
+ wxPen pen( penOrig );
+ if ( m_selected.Ok() &&
+ m_selected.GetDepth() == 1 &&
+ (pen != *wxTRANSPARENT_PEN) )
+ {
+ pen.SetColour( pen.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
+ }
+
+ wxWindowDC::SetPen( pen );
+}
+
+void wxMemoryDC::SetBrush( const wxBrush& brushOrig )
+{
+ wxBrush brush( brushOrig );
+ if ( m_selected.Ok() &&
+ m_selected.GetDepth() == 1 &&
+ (brush != *wxTRANSPARENT_BRUSH) )
+ {
+ brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE);
+ }
+
+ wxWindowDC::SetBrush( brush );
+}
+
+void wxMemoryDC::SetBackground( const wxBrush& brushOrig )