IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC)
-wxMemoryDC::wxMemoryDC()
+wxMemoryDC::wxMemoryDC( const wxBitmap& bitmap )
: m_selected()
{
m_ok = true;
SetPen(*wxBLACK_PEN);
SetFont(*wxNORMAL_FONT);
m_ok = false;
+
+ if ( bitmap.IsOk() )
+ SelectObject(bitmap);
}
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
if (m_selected.Ok())
{
#if wxMAC_USE_CORE_GRAPHICS
- m_selected.UseAlpha() ;
+ if ( m_selected.GetDepth() != 1 )
+ m_selected.UseAlpha() ;
void * data = m_selected.BeginRawAccess() ;
int bitsPerComp = 8 ;
m_graphicContext = new wxMacCGContext( bmCtx ) ;
m_graphicContext->SetPen( m_pen ) ;
m_graphicContext->SetBrush( m_brush ) ;
+ m_graphicContext->SetFont( m_font ) ;
}
m_ok = (m_graphicContext != NULL) ;