In function IMAGELIST_InternalDrawMask we have to mask out overlay mask in

fStyle. Otherwise comparison fStyle == ILD_NORMAL will not work, which leads
to improper display of overlay images.
This commit is contained in:
Serge Ivanov 2000-02-25 20:47:26 +00:00 committed by Alexandre Julliard
parent 4f15239c3a
commit a39cbbc0eb
1 changed files with 13 additions and 12 deletions

View File

@ -191,10 +191,10 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
HBITMAP hOldBitmapImage, hOldBitmapMask; HBITMAP hOldBitmapImage, hOldBitmapMask;
HIMAGELIST himlLocal = pimldp->himl; HIMAGELIST himlLocal = pimldp->himl;
COLORREF oldBkColor, oldFgColor; COLORREF oldBkColor, oldFgColor;
UINT fStyle = pimldp->fStyle & (~ILD_OVERLAYMASK);
bUseCustomBackground = (himlLocal->clrBk != CLR_NONE); bUseCustomBackground = (himlLocal->clrBk != CLR_NONE);
bBlendFlag = (pimldp->fStyle & ILD_BLEND50 ) bBlendFlag = (fStyle & ILD_BLEND50 ) || (fStyle & ILD_BLEND25);
|| (pimldp->fStyle & ILD_BLEND25);
hImageDC = CreateCompatibleDC(0); hImageDC = CreateCompatibleDC(0);
hMaskDC = CreateCompatibleDC(0); hMaskDC = CreateCompatibleDC(0);
@ -203,9 +203,8 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
hOldBitmapMask = SelectObject(hMaskDC, himlLocal->hbmMask); hOldBitmapMask = SelectObject(hMaskDC, himlLocal->hbmMask);
/* Draw the Background for the appropriate Styles /* Draw the Background for the appropriate Styles
*/ */
if( bUseCustomBackground && (pimldp->fStyle == ILD_NORMAL if( bUseCustomBackground &&
|| (pimldp->fStyle & ILD_IMAGE) (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE || bBlendFlag))
|| bBlendFlag))
{ {
hBrush = CreateSolidBrush (himlLocal->clrBk); hBrush = CreateSolidBrush (himlLocal->clrBk);
hOldBrush = SelectObject (pimldp->hdcDst, hBrush); hOldBrush = SelectObject (pimldp->hdcDst, hBrush);
@ -218,9 +217,9 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
/* Draw Image Transparently over the current background /* Draw Image Transparently over the current background
*/ */
if(pimldp->fStyle == ILD_NORMAL if(fStyle == ILD_NORMAL
|| (pimldp->fStyle & ILD_TRANSPARENT) || (fStyle & ILD_TRANSPARENT)
|| ((pimldp->fStyle & ILD_IMAGE) && bUseCustomBackground) || ((fStyle & ILD_IMAGE) && bUseCustomBackground)
|| bBlendFlag) || bBlendFlag)
{ {
/* to obtain a transparent look, background color should be set /* to obtain a transparent look, background color should be set
@ -246,7 +245,7 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
} }
/* Draw the image when no Background is specified /* Draw the image when no Background is specified
*/ */
else if((pimldp->fStyle & ILD_IMAGE) && !bUseCustomBackground) else if((fStyle & ILD_IMAGE) && !bUseCustomBackground)
{ {
BitBlt(pimldp->hdcDst, BitBlt(pimldp->hdcDst,
pimldp->x, pimldp->y, cx, cy, pimldp->x, pimldp->y, cx, cy,
@ -256,7 +255,7 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
} }
/* Draw the mask with or without a background /* Draw the mask with or without a background
*/ */
else if(pimldp->fStyle & ILD_MASK) else if(fStyle & ILD_MASK)
{ {
BitBlt(pimldp->hdcDst, BitBlt(pimldp->hdcDst,
pimldp->x, pimldp->y, cx, cy, pimldp->x, pimldp->y, cx, cy,
@ -388,7 +387,7 @@ IMAGELIST_InternalDrawOverlay(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
HDC hImageDC; HDC hImageDC;
HBITMAP hOldBitmap; HBITMAP hOldBitmap;
nOvlIdx = (pimldp->fStyle & 0x0700) >> 8; nOvlIdx = (pimldp->fStyle & ILD_OVERLAYMASK) >> 8;
if ((nOvlIdx >= 1) && (nOvlIdx <= MAX_OVERLAYIMAGE)) if ((nOvlIdx >= 1) && (nOvlIdx <= MAX_OVERLAYIMAGE))
{ {
nOvlIdx = pimldp->himl->nOvlIdx[nOvlIdx - 1]; nOvlIdx = pimldp->himl->nOvlIdx[nOvlIdx - 1];
@ -1284,7 +1283,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
/* /*
Apply the Overlay if needed Apply the Overlay if needed
*/ */
if (pimldp->fStyle & 0x0700) if (pimldp->fStyle & ILD_OVERLAYMASK)
{ {
IMAGELIST_InternalDrawOverlay(pimldp, cx, cy); IMAGELIST_InternalDrawOverlay(pimldp, cx, cy);
} }
@ -1891,6 +1890,7 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
/* helper for _read_bitmap currently unused */ /* helper for _read_bitmap currently unused */
#if 0
static int may_use_dibsection(HDC hdc) { static int may_use_dibsection(HDC hdc) {
int bitspixel = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES); int bitspixel = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES);
if (bitspixel>8) if (bitspixel>8)
@ -1899,6 +1899,7 @@ static int may_use_dibsection(HDC hdc) {
return FALSE; return FALSE;
return GetDeviceCaps(hdc,94) & 0x10; return GetDeviceCaps(hdc,94) & 0x10;
} }
#endif
/* helper for ImageList_Read, see comments below */ /* helper for ImageList_Read, see comments below */
static HBITMAP _read_bitmap(LPSTREAM pstm,int ilcFlag,int cx,int cy) { static HBITMAP _read_bitmap(LPSTREAM pstm,int ilcFlag,int cx,int cy) {