-bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), int WXUNUSED(type), const wxPalette *WXUNUSED(palette))
-{
- return FALSE;
-}
+ // this is not very efficient, but I can't think of a better way of doing
+ // it
+ for ( int w = 0; w < width; w++ )
+ {
+ for ( int h = 0; h < height; h++ )
+ {
+ COLORREF col = GetPixel(srcDC, w, h);
+ if ( col == CLR_INVALID )
+ {
+ wxLogLastError("GetPixel");
+
+ // doesn't make sense to continue
+ ::SelectObject(srcDC, 0);
+ ::DeleteDC(srcDC);
+ ::SelectObject(destDC, 0);
+ ::DeleteDC(destDC);
+
+ return FALSE;
+ }
+
+ if ( col == maskColour )
+ {
+ ::SetPixel(destDC, w, h, RGB(0, 0, 0));
+ }
+ else
+ {
+ ::SetPixel(destDC, w, h, RGB(255, 255, 255));
+ }
+ }
+ }