]> git.saurik.com Git - wxWidgets.git/commitdiff
correct a bug in the MSW code using wxMask
authorUnknown (AN) <nobody@localhost>
Thu, 10 Dec 1998 22:41:43 +0000 (22:41 +0000)
committerUnknown (AN) <nobody@localhost>
Thu, 10 Dec 1998 22:41:43 +0000 (22:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/image.cpp

index 77a40d50dbb4486982121d393a33bf30bcaa4d9c..142eed198a20634c6835b676b0be46e6c89c1921 100644 (file)
@@ -1107,28 +1107,28 @@ wxBitmap wxImage::ConvertToBitmap() const
     for( int i=0; i<width*height; i++ )
     {
       if( (*(ptdata++)!=r) | (*(ptdata++)!=g) | (*(ptdata++)!=b) )
-      {
-        *(ptbits++) = zero;
-        *(ptbits++) = zero;
-        *(ptbits++) = zero;
-      }
-      else
       {
         *(ptbits++) = one;
         *(ptbits++) = one;
         *(ptbits++) = one;
       }
+      else
+      {
+        *(ptbits++) = zero;
+        *(ptbits++) = zero;
+        *(ptbits++) = zero;
+      }
     }
     hbitmap = ::CreateBitmap( (WORD)width, (WORD)height, 1, 1, NULL );
     ::SetDIBits( hdc, hbitmap, 0, (WORD)height, lpBits, lpDIBh, DIB_RGB_COLORS);
-    wxMask bmpmask;
-    bmpmask.SetMaskBitmap( (WXHBITMAP) hbitmap );
-    bitmap.SetMask( &bmpmask );
+    wxMask *mask = new wxMask();
+    mask->SetMaskBitmap( (WXHBITMAP) hbitmap );
+    bitmap.SetMask( mask );
 
 /* The following can also be used but is slow to run
     wxColour colour( GetMaskRed(), GetMaskGreen(), GetMaskBlue());
-    wxMask bmpmask( bitmap, colour );
-    bitmap.SetMask( &bmpmask );
+    wxMask *mask = new wxMask( bitmap, colour );
+    bitmap.SetMask( mask );
 */
   }