if ( type == wxBITMAP_TYPE_BMP_RESOURCE )
{
- hBitmap = ::LoadBitmap(wxGetInstance(), name.t_str());
+ hBitmap.Init( ::LoadBitmap(wxGetInstance(), name.t_str()) );
if ( !hBitmap )
{
return wxImage();
}
- hBitmap = info.hbmColor;
- hMask = info.hbmMask;
+ hBitmap.Init(info.hbmColor);
+ hMask.Init(info.hbmMask);
}
}
else if ( type == wxBITMAP_TYPE_CUR_RESOURCE )
image.SetMaskColour(0xc0, 0xc0, 0xc0);
}
- image.InitAlpha();
+ // We could have already loaded alpha from the resources, but if not,
+ // initialize it now using the mask.
+ if ( !image.HasAlpha() )
+ image.InitAlpha();
return image;
}