+ maskBitmap.Create( width, height, 1);
+ LockPixels( GetGWorldPixMap(maskBitmap.GetHBITMAP()) );
+ SetGWorld(maskBitmap.GetHBITMAP(), NULL);
+
+ for (int y = 0; y < height; y++)
+ {
+ for (int x = 0; x < width; x++)
+ {
+ if ( data[0] == image.GetMaskRed() && data[1] == image.GetMaskGreen() && data[2] == image.GetMaskBlue() )
+ {
+ SetCPixel(x,y, &white);
+ }
+ else {
+ SetCPixel(x,y, &black);
+ }
+ data += 3 ;
+ }
+ } // for height
+ SetGWorld(GetHBITMAP(), NULL);
+ SetMask(new wxMask( maskBitmap ));
+ UnlockPixels( GetGWorldPixMap(maskBitmap.GetHBITMAP()) );