#include <memory.h>
#endif
-#ifdef __GNUWIN32_OLD__
- #include "wx/msw/gnuwin32/extra.h"
-#endif
-
#include "wx/image.h"
#include "wx/msw/dib.h"
{
// only 1, 4 and 8bpp bitmaps use palettes (well, they could be used with
// 24bpp ones too but we don't support this as I think it's quite uncommon)
- return bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0;
+ return (WORD)(bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0);
}
// wrapper around ::GetObject() for DIB sections
info->bmiHeader.biHeight = height;
info->bmiHeader.biPlanes = 1;
- info->bmiHeader.biBitCount = depth;
+ info->bmiHeader.biBitCount = (WORD)depth;
info->bmiHeader.biSizeImage = GetLineSize(width, depth)*height;
m_handle = ::CreateDIBSection
// initialize the palette header
pPalette->palVersion = 0x300; // magic number, not in docs but works
- pPalette->palNumEntries = biClrUsed;
+ pPalette->palNumEntries = (WORD)biClrUsed;
// and the colour table (it starts right after the end of the header)
const RGBQUAD *pRGB = (RGBQUAD *)((char *)&ds.dsBmih + ds.dsBmih.biSize);
// RGB order is reversed, and we need to premultiply
// all channels by alpha value for use with ::AlphaBlend.
const unsigned char a = *alpha++;
- *dst++ = (src[2] * a + 127) / 255;
- *dst++ = (src[1] * a + 127) / 255;
- *dst++ = (src[0] * a + 127) / 255;
+ *dst++ = (unsigned char)((src[2] * a + 127) / 255);
+ *dst++ = (unsigned char)((src[1] * a + 127) / 255);
+ *dst++ = (unsigned char)((src[0] * a + 127) / 255);
*dst++ = a;
src += 3;
}