win32 interface: fixed bitmap drawing in menu items (issue #7427) from Martin Smat

git-svn-id: trunk@10006 -
This commit is contained in:
vincents 2006-09-30 09:58:05 +00:00
parent 0c307f6bf0
commit 4261b2aceb

View File

@ -395,11 +395,10 @@ procedure DrawMenuItemIcon(const aMenuItem: TMenuItem; const aHDC: HDC; const aR
var hdcMem: HDC;
hbmpOld: HBITMAP;
begin
hdcMem := CreateCompatibleDC(aHDC);
hdcMem := aMenuItem.Bitmap.Canvas.Handle;
hbmpOld := SelectObject(hdcMem, aMenuItem.Bitmap.Handle);
TWin32WidgetSet(WidgetSet).MaskBlt(aHDC, aRect.left + LeftIconPosition, aRect.top + TopPosition(aRect.bottom - aRect.top, aMenuItem.Bitmap.Height), aMenuItem.Bitmap.Width, aMenuItem.Bitmap.Height, hdcMem, 0, 0, aMenuItem.Bitmap.MaskHandle, 0, 0);
SelectObject(hdcMem, hbmpOld);
DeleteDC(hdcMem);
end;
procedure DrawMenuItem(const aMenuItem: TMenuItem; const aHDC: HDC; const aRect: Windows.RECT; const aSelected: boolean);