+ else if (isPrinter) // not masked, not pixel copy
+ {
+ wxBitmap& bmp = source->m_selectedBitmap ;
+ BITMAPINFO *info = (BITMAPINFO *) malloc( sizeof( BITMAPINFOHEADER ) + 256 * sizeof(RGBQUAD ) ) ;
+ int iBitsSize = ((bmp.GetWidth() + 3 ) & ~3 ) * bmp.GetHeight() ;
+
+ void* bits = malloc( iBitsSize ) ;
+
+ memset( info , 0 , sizeof( BITMAPINFOHEADER ) ) ;
+
+ info->bmiHeader.biSize = sizeof( BITMAPINFOHEADER ) ;
+ info->bmiHeader.biWidth = bmp.GetWidth() ;
+ info->bmiHeader.biHeight = bmp.GetHeight() ;
+ info->bmiHeader.biPlanes = 1 ;
+ info->bmiHeader.biBitCount = 8 ;
+ info->bmiHeader.biCompression = BI_RGB ;
+
+ HDC display = GetDC( NULL ) ;
+ if ( GetDIBits( display , (HBITMAP) bmp.GetHBITMAP( ) , 0 , bmp.GetHeight() , bits , info , DIB_RGB_COLORS ) )
+ {
+ success = (GDI_ERROR != StretchDIBits( (HDC) m_hDC,
+ xdest1, ydest1, bmp.GetWidth(), bmp.GetHeight() ,
+ xsrc1 , ysrc1 ,bmp.GetWidth(), bmp.GetHeight() ,
+ bits , info , DIB_RGB_COLORS , SRCCOPY )) ;
+ }
+ else
+ success = FALSE;
+ ReleaseDC( NULL , display ) ;
+ free ( bits ) ;
+ free( info ) ;
+ }
+ else // Not masked, not printer, not pixel copy
+ {
+ success = (BitBlt(GetHdc(), xdest1, ydest1, (int)width, (int)height, (HDC) source->m_hDC,
+ xsrc1, ysrc1, dwRop) != 0);
+ }