Icons with alpha channel are not displayed correctly
Original Reporter info from Mantis: cobines
-
Reporter name:
Original Reporter info from Mantis: cobines
- Reporter name:
Description:
Test project attached.
icontest.png shows how it looks like currently (bad) and how it should look like (good).
Problem is in the procedure:
function TWin32WidgetSet.RawImage_FromBitmap(out ARawImage: TRawImage; ABitmap, AMask: HBITMAP; ARect: PRect = nil): Boolean;
There is code:
// if it is not DIB then alpha in bitmaps is not supported => use 0 alpha prec
if ASize < SizeOf(WinDIB) then
ARawImage.Description.AlphaPrec := 0;
Windows.GetObject call must return DIBSECTION structure according to the code above. However, from my tests, when bitmaps of ICON are passed to GetObject (hbmColor, hbmMask) it only returns basic BITMAP structure.
If the above code is removed the icon is displayed correctly.
The above code also exists in
function TWin32WidgetSet.RawImage_DescriptionFromBitmap(ABitmap: HBITMAP; out ADesc: TRawImageDescription): Boolean;
Mantis conversion info:
- Mantis ID: 19748
- OS: Windows XP
- OS Build: SP3
- Build: 31679
- Platform: Win32
- Version: 0.9.31 (SVN)
- Monitored by: » Vincent (Vincent Snijders), » mike.cornflake (Mike Thompson), » @bonmario (Mario Bonati)