// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "bitmap.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
unsigned char* pixels = dib.GetData();
for (int idx=0; idx<w*h*4; idx+=4)
{
- if (pixels[idx+3] != 0)
+ if (pixels[idx+3] != 0)
{
// If there is an alpha byte that is non-zero then set the
// alpha flag and bail out of the loop.
// wxWin convention
refData->SetMask(wxInvertMask(iconInfo.hbmMask, w, h));
}
-
+
// delete the old one now as we don't need it any more
::DeleteObject(iconInfo.hbmMask);
SetMask(new wxMask((WXHBITMAP)hbitmap));
}
- delete data;
+ delete[] data;
}
return true;
#ifndef __WXMICROWIN__
// handle alpha channel, if any
if (HasAlpha())
- ret.UseAlpha();
+ ret.UseAlpha();
// copy bitmap data
MemoryHDC dcSrc,
HBITMAP hDIB;
if ( !GetBitmapData()->m_isDIB )
{
- wxCHECK_MSG( !GetBitmapData()->m_dib, FALSE,
+ wxCHECK_MSG( !GetBitmapData()->m_dib, NULL,
_T("GetRawData() may be called only once") );
wxDIB *dib = new wxDIB(*this);
// this value must be 1, 4, 8 or 24 so PixelDepth can only be
lpDIBheader->bmiHeader.biBitCount = (WORD)(bitsPerPixel);
lpDIBheader->bmiHeader.biCompression = BI_RGB;
- lpDIBheader->bmiHeader.biSizeImage = xSize * abs(ySize) * bitsPerPixel >> 3;
+ lpDIBheader->bmiHeader.biSizeImage = (xSize * abs(ySize) * bitsPerPixel) >> 3;
lpDIBheader->bmiHeader.biClrUsed = 256;
{
mask = bmp.GetMask();
}
-
+
if ( !mask )
{
// we must have a mask for an icon, so even if it's probably incorrect,