In ImageList_Draw when drawing the bitmap with the transparent flag
set, background color/foreground color should be set to white/black, when doing bitblt operation with the bitmap mask.
This commit is contained in:
parent
56a8644718
commit
274925980d
|
@ -188,6 +188,7 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
|
||||||
HBRUSH hBrush, hOldBrush;
|
HBRUSH hBrush, hOldBrush;
|
||||||
HBITMAP hOldBitmapImage, hOldBitmapMask;
|
HBITMAP hOldBitmapImage, hOldBitmapMask;
|
||||||
HIMAGELIST himlLocal = pimldp->himl;
|
HIMAGELIST himlLocal = pimldp->himl;
|
||||||
|
COLORREF oldBkColor, oldFgColor;
|
||||||
|
|
||||||
bUseCustomBackground = (himlLocal->clrBk != CLR_NONE);
|
bUseCustomBackground = (himlLocal->clrBk != CLR_NONE);
|
||||||
bBlendFlag = (pimldp->fStyle & ILD_BLEND50 )
|
bBlendFlag = (pimldp->fStyle & ILD_BLEND50 )
|
||||||
|
@ -220,6 +221,12 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
|
||||||
|| ((pimldp->fStyle & ILD_IMAGE) && bUseCustomBackground)
|
|| ((pimldp->fStyle & ILD_IMAGE) && bUseCustomBackground)
|
||||||
|| bBlendFlag)
|
|| bBlendFlag)
|
||||||
{
|
{
|
||||||
|
/* to obtain a transparent look, background color should be set
|
||||||
|
to white and foreground color to black when blting the
|
||||||
|
monochrome mask. */
|
||||||
|
oldBkColor = SetBkColor(pimldp->hdcDst, RGB(0xff, 0xff, 0xff));
|
||||||
|
oldFgColor = SetTextColor(pimldp->hdcDst, RGB(0, 0, 0));
|
||||||
|
|
||||||
BitBlt(pimldp->hdcDst,
|
BitBlt(pimldp->hdcDst,
|
||||||
pimldp->x, pimldp->y, cx, cy,
|
pimldp->x, pimldp->y, cx, cy,
|
||||||
hMaskDC,
|
hMaskDC,
|
||||||
|
@ -231,6 +238,9 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
|
||||||
hImageDC,
|
hImageDC,
|
||||||
himlLocal->cx * pimldp->i, 0,
|
himlLocal->cx * pimldp->i, 0,
|
||||||
SRCPAINT);
|
SRCPAINT);
|
||||||
|
|
||||||
|
SetBkColor(pimldp->hdcDst, oldBkColor);
|
||||||
|
SetTextColor(pimldp->hdcDst, oldFgColor);
|
||||||
}
|
}
|
||||||
/* Draw the image when no Background is specified
|
/* Draw the image when no Background is specified
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue