+ if (m_bitmap.Ok() && (bitmap.GetDisplay() == m_display))
+ {
+ m_pixmap = m_bitmap.GetDrawable();
+ Display* display = (Display*) m_display;
+
+ XGCValues gcvalues;
+ gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
+ gcvalues.background = WhitePixel (display, DefaultScreen (display));
+ gcvalues.graphics_exposures = False;
+ gcvalues.subwindow_mode = IncludeInferiors;
+ gcvalues.line_width = 1;
+ m_gc = (WXGC) XCreateGC (display, (Drawable)m_pixmap/* RootWindow (display, DefaultScreen (display)) */,
+ GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
+ &gcvalues);
+
+ m_backgroundPixel = gcvalues.background;
+ m_ok = true;
+
+ SetBrush (* wxWHITE_BRUSH);
+ SetPen (* wxBLACK_PEN);
+ }
+ else
+ {
+ m_ok = false;
+ m_pixmap = (WXPixmap) 0;
+ };
+}
+
+void wxMemoryDC::DoGetSize( int *width, int *height ) const
+{
+ if (m_bitmap.Ok())
+ {
+ if (width) (*width) = m_bitmap.GetWidth();
+ if (height) (*height) = m_bitmap.GetHeight();
+ }
+ else
+ {
+ if (width) (*width) = 0;
+ if (height) (*height) = 0;
+ };
+}