Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
e7b84a9b
Commit
e7b84a9b
authored
24 years ago
by
Jason Mawdsley
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some flickering that was occurring in the image list control
when it repainted.
parent
c472708f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/comctl32/imagelist.c
+108
-49
108 additions, 49 deletions
dlls/comctl32/imagelist.c
with
108 additions
and
49 deletions
dlls/comctl32/imagelist.c
+
108
−
49
View file @
e7b84a9b
...
...
@@ -2,6 +2,7 @@
* ImageList implementation
*
* Copyright 1998 Eric Kohl
* 2000 Jason Mawdsley.
*
* TODO:
* - Fix ImageList_DrawIndirect (xBitmap, yBitmap, rgbFg, rgbBk, dwRop).
...
...
@@ -160,6 +161,25 @@ IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
}
/*************************************************************************
* IMAGELIST_InternalDrawMask [Internal]
*
* Draws the image in the ImageList witht the mask
*
* PARAMS
* pimldp [I] pointer to IMAGELISTDRAWPARAMS structure.
* cx [I] the width of the image to display
* cy............[I] the height of the image to display
*
* RETURNS
* nothing
*
* NOTES
* This functions is used by ImageList_DrawIndirect, when it is
* required to draw the Image with the mask to the screen.
*
* Blending and Overlays styles are accomplised by another function.
*/
/*************************************************************************
* IMAGELIST_InternalDrawMask [Internal]
*
...
...
@@ -182,88 +202,127 @@ IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
static
VOID
IMAGELIST_InternalDrawMask
(
IMAGELISTDRAWPARAMS
*
pimldp
,
INT
cx
,
INT
cy
)
{
HDC
hMaskDC
,
hImageDC
;
BOOL
bUseCustomBackground
,
bBlendFlag
;
HBRUSH
hBrush
,
hOldBrush
;
HDC
hMaskDC
,
hImageDC
;
HBITMAP
hOldBitmapImage
,
hOldBitmapMask
;
HIMAGELIST
himlLocal
=
pimldp
->
himl
;
COLORREF
oldBkColor
,
oldFgColor
;
UINT
fStyle
=
pimldp
->
fStyle
&
(
~
ILD_OVERLAYMASK
);
/*
* We need a dc and bitmap to draw on that is
* not on the screen.
*/
HDC
hOffScreenDC
=
0
;
HBITMAP
hOffScreenBmp
=
0
;
bUseCustomBackground
=
(
himlLocal
->
clrBk
!=
CLR_NONE
);
bBlendFlag
=
(
fStyle
&
ILD_BLEND50
)
||
(
fStyle
&
ILD_BLEND25
);
hImageDC
=
CreateCompatibleDC
(
0
);
hMaskDC
=
CreateCompatibleDC
(
0
);
/* Create a compatible DC. */
hOffScreenDC
=
CreateCompatibleDC
(
pimldp
->
hdcDst
);
if
(
hOffScreenDC
)
{
hOffScreenBmp
=
CreateCompatibleBitmap
(
pimldp
->
hdcDst
,
cx
,
cy
);
if
(
hOffScreenBmp
)
SelectObject
(
hOffScreenDC
,
hOffScreenBmp
);
else
goto
cleanup
;
}
else
goto
cleanup
;
hOldBitmapImage
=
SelectObject
(
hImageDC
,
himlLocal
->
hbmImage
);
hOldBitmapMask
=
SelectObject
(
hMaskDC
,
himlLocal
->
hbmMask
);
/* Draw the Background for the appropriate Styles
*/
if
(
bUseCustomBackground
&&
(
fStyle
==
ILD_NORMAL
||
fStyle
&
ILD_IMAGE
||
bBlendFlag
))
/*
* Get a copy of the image for the masking operations.
* We will use the copy, and this dc for all the various
* blitting, and then do one final blit to the screen dc.
* This should clean up most of the flickering.
*/
BitBlt
(
hOffScreenDC
,
0
,
0
,
cx
,
cy
,
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
SRCCOPY
);
/*
* Draw the Background for the appropriate Styles
*/
if
(
bUseCustomBackground
&&
(
fStyle
==
ILD_NORMAL
||
fStyle
&
ILD_IMAGE
||
bBlendFlag
)
)
{
hBrush
=
CreateSolidBrush
(
himlLocal
->
clrBk
);
hOldBrush
=
SelectObject
(
pimldp
->
hdcDst
,
hBrush
);
PatBlt
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
PATCOPY
);
PatBlt
(
hOffScreenDC
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
PATCOPY
);
DeleteObject
(
SelectObject
(
pimldp
->
hdcDst
,
hOldBrush
));
}
/* Draw Image Transparently over the current background
*/
if
(
fStyle
==
ILD_NORMAL
||
(
fStyle
&
ILD_TRANSPARENT
)
||
((
fStyle
&
ILD_IMAGE
)
&&
bUseCustomBackground
)
||
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
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
hMaskDC
,
himlLocal
->
cx
*
pimldp
->
i
,
0
,
SRCAND
);
BitBlt
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
hImageDC
,
himlLocal
->
cx
*
pimldp
->
i
,
0
,
SRCPAINT
);
SetBkColor
(
pimldp
->
hdcDst
,
oldBkColor
);
SetTextColor
(
pimldp
->
hdcDst
,
oldFgColor
);
/*
* Draw Image Transparently over the current background
*/
if
(
fStyle
==
ILD_NORMAL
||
(
fStyle
&
ILD_TRANSPARENT
)
||
((
fStyle
&
ILD_IMAGE
)
&&
bUseCustomBackground
)
||
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
(
hOffScreenDC
,
RGB
(
0xff
,
0xff
,
0xff
)
);
oldFgColor
=
SetTextColor
(
hOffScreenDC
,
RGB
(
0
,
0
,
0
)
);
BitBlt
(
hOffScreenDC
,
0
,
0
,
cx
,
cy
,
hMaskDC
,
himlLocal
->
cx
*
pimldp
->
i
,
0
,
SRCAND
);
BitBlt
(
hOffScreenDC
,
0
,
0
,
cx
,
cy
,
hImageDC
,
himlLocal
->
cx
*
pimldp
->
i
,
0
,
SRCPAINT
);
}
/* Draw the image when no Background is specified
*/
/*
* Draw the image when no Background is specified
*/
else
if
((
fStyle
&
ILD_IMAGE
)
&&
!
bUseCustomBackground
)
{
BitBlt
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
hImageDC
,
himlLocal
->
cx
*
pimldp
->
i
,
0
,
SRCCOPY
);
BitBlt
(
hOffScreenDC
,
0
,
0
,
cx
,
cy
,
hImageDC
,
himlLocal
->
cx
*
pimldp
->
i
,
0
,
SRCCOPY
);
}
/* Draw the mask with or without a background
*/
/*
* Draw the mask with or without a background
*/
else
if
(
fStyle
&
ILD_MASK
)
{
BitBlt
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
hMaskDC
,
himlLocal
->
cx
*
pimldp
->
i
,
0
,
bUseCustomBackground
?
SRCCOPY
:
SRCAND
);
BitBlt
(
hOffScreenDC
,
0
,
0
,
cx
,
cy
,
hMaskDC
,
himlLocal
->
cx
*
pimldp
->
i
,
0
,
bUseCustomBackground
?
SRCCOPY
:
SRCAND
);
}
/*
* Blit the bitmap to the screen now.
*/
BitBlt
(
pimldp
->
hdcDst
,
pimldp
->
x
,
pimldp
->
y
,
cx
,
cy
,
hOffScreenDC
,
0
,
0
,
SRCCOPY
);
SelectObject
(
hImageDC
,
hOldBitmapImage
);
SelectObject
(
hMaskDC
,
hOldBitmapMask
);
cleanup:
DeleteDC
(
hImageDC
);
DeleteDC
(
hMaskDC
);
DeleteDC
(
hOffScreenDC
);
DeleteObject
(
hOffScreenBmp
);
return
;
}
/*************************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment