X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd90675b89c7f0b8fb9c6749f8314a26e23b1b95..50a2a3553af0449fefad444c04e91dea2589092c:/src/msw/dib.cpp diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 23ed673d49..da8b42d1fc 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -688,12 +688,14 @@ bool wxDIB::Create(const wxImage& image, PixelFormat pf) 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(). - 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); @@ -706,7 +708,7 @@ bool wxDIB::Create(const wxImage& image, PixelFormat pf) 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];