- GWorldPtr bmapworld = MAC_WXHBITMAP( bmp.GetHBITMAP() );
- PixMapHandle bmappixels ;
- // Set foreground and background colours (for bitmaps depth = 1)
- if(bmp.GetDepth() == 1)
- {
- RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel());
- RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel());
- RGBForeColor(&fore);
- RGBBackColor(&back);
- }
- else
- {
- RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
- RGBColor black = { 0,0,0} ;
- RGBForeColor( &black ) ;
- RGBBackColor( &white ) ;
- }
- bmappixels = GetGWorldPixMap( bmapworld ) ;
- wxCHECK_RET(LockPixels(bmappixels),
- wxT("DoDrawBitmap: Unable to lock pixels"));
- Rect source = { 0, 0, h, w };
- Rect dest = { yy, xx, yy + hh, xx + ww };
- if ( useMask && bmp.GetMask() )
+ RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel());
+ RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel());
+ RGBForeColor(&fore);
+ RGBBackColor(&back);
+ }
+ else
+ {
+ RGBColor white = { 0xFFFF, 0xFFFF, 0xFFFF } ;
+ RGBColor black = { 0, 0, 0 } ;
+ RGBForeColor( &black ) ;
+ RGBBackColor( &white ) ;
+ }
+ bmappixels = GetGWorldPixMap( bmapworld ) ;
+
+ wxCHECK_RET(LockPixels(bmappixels),
+ wxT("wxDC::DoDrawBitmap - failed to lock pixels"));
+
+ Rect source = { 0, 0, h, w };
+ Rect dest = { yy, xx, yy + hh, xx + ww };
+ if ( useMask && maskworld )
+ {
+ if ( LockPixels(GetGWorldPixMap(MAC_WXHBITMAP(maskworld))))