Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
95c529de
Commit
95c529de
authored
Jun 02, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Only support an alpha channel for 32-bpp DIB-based imagelists.
parent
eb3c81fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
imagelist.c
dlls/comctl32/imagelist.c
+11
-10
toolbar.c
dlls/comctl32/toolbar.c
+2
-2
No files found.
dlls/comctl32/imagelist.c
View file @
95c529de
...
...
@@ -153,8 +153,9 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count,
if
(
!
GetObjectW
(
hbmImage
,
sizeof
(
bm
),
&
bm
))
return
FALSE
;
/* if neither the imagelist nor the source bitmap can have an alpha channel, bail out now */
if
(
himl
->
uBitsPixel
!=
32
&&
bm
.
bmBitsPixel
!=
32
)
return
FALSE
;
/* if either the imagelist or the source bitmap don't have an alpha channel, bail out now */
if
(
!
himl
->
has_alpha
)
return
FALSE
;
if
(
bm
.
bmBitsPixel
!=
32
)
return
FALSE
;
SelectObject
(
hdc
,
hbmImage
);
mask_width
=
(
bm
.
bmWidth
+
31
)
/
32
*
4
;
...
...
@@ -208,7 +209,7 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count,
}
else
{
if
(
himl
->
has_alpha
)
himl
->
has_alpha
[
pos
+
n
]
=
1
;
himl
->
has_alpha
[
pos
+
n
]
=
1
;
if
(
mask_info
&&
himl
->
hbmMask
)
/* generate the mask from the alpha channel */
{
...
...
@@ -751,7 +752,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
else
himl
->
hbmMask
=
0
;
if
(
himl
->
uBitsPixel
==
32
)
if
(
ilc
==
ILC_COLOR
32
)
himl
->
has_alpha
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
himl
->
cMaxImage
);
else
himl
->
has_alpha
=
NULL
;
...
...
@@ -1204,7 +1205,7 @@ static BOOL alpha_blend_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int des
}
}
if
(
himl
->
uBitsPixel
==
32
)
/* we already have an alpha channel in this case */
if
(
himl
->
has_alpha
)
/* we already have an alpha channel in this case */
{
/* pre-multiply by the alpha channel */
for
(
i
=
0
,
ptr
=
bits
;
i
<
cx
*
cy
;
i
++
,
ptr
++
)
...
...
@@ -2515,7 +2516,7 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
if
(
hdcImage
==
0
)
ERR
(
"invalid hdcImage!
\n
"
);
if
(
himl
->
uBitsPixel
==
32
)
if
(
himl
->
has_alpha
)
{
if
(
!
ii
.
hbmColor
)
{
...
...
@@ -2525,13 +2526,13 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
SelectObject
(
hdcImage
,
color
);
SelectObject
(
hdcMask
,
ii
.
hbmMask
);
BitBlt
(
hdcImage
,
0
,
0
,
bmp
.
bmWidth
,
height
,
hdcMask
,
0
,
height
,
SRCCOPY
);
add_with_alpha
(
himl
,
hdcImage
,
nIndex
,
1
,
bmp
.
bmWidth
,
height
,
color
,
ii
.
hbmMask
);
ret
=
add_with_alpha
(
himl
,
hdcImage
,
nIndex
,
1
,
bmp
.
bmWidth
,
height
,
color
,
ii
.
hbmMask
);
DeleteDC
(
hdcMask
);
DeleteObject
(
color
);
if
(
ret
)
goto
done
;
}
else
add_with_alpha
(
himl
,
hdcImage
,
nIndex
,
1
,
bmp
.
bmWidth
,
bmp
.
bmHeight
,
ii
.
hbmColor
,
ii
.
hbmMask
);
goto
done
;
else
if
(
add_with_alpha
(
himl
,
hdcImage
,
nIndex
,
1
,
bmp
.
bmWidth
,
bmp
.
bmHeight
,
ii
.
hbmColor
,
ii
.
hbmMask
))
goto
done
;
}
imagelist_point_from_index
(
himl
,
nIndex
,
&
pt
);
...
...
dlls/comctl32/toolbar.c
View file @
95c529de
...
...
@@ -2757,7 +2757,7 @@ TOOLBAR_CheckImageListIconSize(TOOLBAR_INFO *infoPtr)
cx
,
cy
,
infoPtr
->
nBitmapWidth
,
infoPtr
->
nBitmapHeight
);
himlNew
=
ImageList_Create
(
infoPtr
->
nBitmapWidth
,
infoPtr
->
nBitmapHeight
,
ILC_COLOR
DDB
|
ILC_MASK
,
8
,
2
);
ILC_COLOR
32
|
ILC_MASK
,
8
,
2
);
for
(
i
=
0
;
i
<
infoPtr
->
nNumBitmapInfos
;
i
++
)
TOOLBAR_AddBitmapToImageList
(
infoPtr
,
himlNew
,
&
infoPtr
->
bitmaps
[
i
]);
TOOLBAR_InsertImageList
(
&
infoPtr
->
himlDef
,
&
infoPtr
->
cimlDef
,
himlNew
,
0
);
...
...
@@ -2854,7 +2854,7 @@ TOOLBAR_AddBitmap (TOOLBAR_INFO *infoPtr, INT count, const TBADDBITMAP *lpAddBmp
TRACE
(
"creating default image list!
\n
"
);
himlDef
=
ImageList_Create
(
infoPtr
->
nBitmapWidth
,
infoPtr
->
nBitmapHeight
,
ILC_COLOR
DDB
|
ILC_MASK
,
info
.
nButtons
,
2
);
ILC_COLOR
32
|
ILC_MASK
,
info
.
nButtons
,
2
);
TOOLBAR_InsertImageList
(
&
infoPtr
->
himlDef
,
&
infoPtr
->
cimlDef
,
himlDef
,
0
);
infoPtr
->
himlInt
=
himlDef
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment