]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dib.cpp
Save the mode in SetMode
[wxWidgets.git] / src / msw / dib.cpp
index 23ed673d494e341ca42ab250e81932bb06aa6246..da8b42d1fc3b78ca69dad9d3059db357f23e442d 100644 (file)
@@ -688,12 +688,14 @@ bool wxDIB::Create(const wxImage& image, PixelFormat pf)
         unsigned char *dst = dstLineStart;
         if ( alpha )
         {
         unsigned char *dst = dstLineStart;
         if ( alpha )
         {
+            int x;
+
             switch ( pf )
             {
                 case PixelFormat_PreMultiplied:
                     // Pre-multiply pixel values so that the DIB could be used
                     // with ::AlphaBlend().
             switch ( pf )
             {
                 case PixelFormat_PreMultiplied:
                     // Pre-multiply pixel values so that the DIB could be used
                     // with ::AlphaBlend().
-                    for ( int x = 0; x < w; x++ )
+                    for ( x = 0; x < w; x++ )
                     {
                         const unsigned char a = *alpha++;
                         *dst++ = (unsigned char)((src[2] * a + 127) / 255);
                     {
                         const unsigned char a = *alpha++;
                         *dst++ = (unsigned char)((src[2] * a + 127) / 255);
@@ -706,7 +708,7 @@ bool wxDIB::Create(const wxImage& image, PixelFormat pf)
 
                 case PixelFormat_NotPreMultiplied:
                     // Just copy pixel data without changing it.
 
                 case PixelFormat_NotPreMultiplied:
                     // Just copy pixel data without changing it.
-                    for ( int x = 0; x < w; x++ )
+                    for ( x = 0; x < w; x++ )
                     {
                         *dst++ = src[2];
                         *dst++ = src[1];
                     {
                         *dst++ = src[2];
                         *dst++ = src[1];