Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e0fc985f
Commit
e0fc985f
authored
Dec 16, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Use GetDIBits to retrieve the default color map for an imagelist DIB section.
parent
40cf298c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
37 deletions
+11
-37
imagelist.c
dlls/comctl32/imagelist.c
+11
-37
No files found.
dlls/comctl32/imagelist.c
View file @
e0fc985f
...
@@ -3093,54 +3093,28 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count)
...
@@ -3093,54 +3093,28 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count)
if
((
ilc
>=
ILC_COLOR4
&&
ilc
<=
ILC_COLOR32
)
||
ilc
==
ILC_COLOR
)
if
((
ilc
>=
ILC_COLOR4
&&
ilc
<=
ILC_COLOR32
)
||
ilc
==
ILC_COLOR
)
{
{
VOID
*
bits
;
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
)]
;
BITMAPINFO
*
bmi
;
BITMAPINFO
*
bmi
=
(
BITMAPINFO
*
)
buffer
;
TRACE
(
"Creating DIBSection %d x %d, %d Bits per Pixel
\n
"
,
TRACE
(
"Creating DIBSection %d x %d, %d Bits per Pixel
\n
"
,
sz
.
cx
,
sz
.
cy
,
himl
->
uBitsPixel
);
sz
.
cx
,
sz
.
cy
,
himl
->
uBitsPixel
);
if
(
himl
->
uBitsPixel
<=
ILC_COLOR8
)
memset
(
buffer
,
0
,
sizeof
(
buffer
)
);
{
LPPALETTEENTRY
pal
;
ULONG
i
,
colors
;
BYTE
temp
;
colors
=
1
<<
himl
->
uBitsPixel
;
bmi
=
Alloc
(
sizeof
(
BITMAPINFOHEADER
)
+
sizeof
(
PALETTEENTRY
)
*
colors
);
pal
=
(
LPPALETTEENTRY
)
bmi
->
bmiColors
;
GetPaletteEntries
(
GetStockObject
(
DEFAULT_PALETTE
),
0
,
colors
,
pal
);
/* Swap colors returned by GetPaletteEntries so we can use them for
* CreateDIBSection call. */
for
(
i
=
0
;
i
<
colors
;
i
++
)
{
temp
=
pal
[
i
].
peBlue
;
bmi
->
bmiColors
[
i
].
rgbRed
=
pal
[
i
].
peRed
;
bmi
->
bmiColors
[
i
].
rgbBlue
=
temp
;
}
}
else
{
bmi
=
Alloc
(
sizeof
(
BITMAPINFOHEADER
));
}
bmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
bmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
bmi
->
bmiHeader
.
biWidth
=
sz
.
cx
;
bmi
->
bmiHeader
.
biWidth
=
sz
.
cx
;
bmi
->
bmiHeader
.
biHeight
=
sz
.
cy
;
bmi
->
bmiHeader
.
biHeight
=
sz
.
cy
;
bmi
->
bmiHeader
.
biPlanes
=
1
;
bmi
->
bmiHeader
.
biPlanes
=
1
;
bmi
->
bmiHeader
.
biBitCount
=
himl
->
uBitsPixel
;
bmi
->
bmiHeader
.
biBitCount
=
himl
->
uBitsPixel
;
bmi
->
bmiHeader
.
biCompression
=
BI_RGB
;
bmi
->
bmiHeader
.
biCompression
=
BI_RGB
;
bmi
->
bmiHeader
.
biSizeImage
=
0
;
bmi
->
bmiHeader
.
biXPelsPerMeter
=
0
;
bmi
->
bmiHeader
.
biYPelsPerMeter
=
0
;
bmi
->
bmiHeader
.
biClrUsed
=
0
;
bmi
->
bmiHeader
.
biClrImportant
=
0
;
hbmNewBitmap
=
CreateDIBSection
(
hdc
,
bmi
,
DIB_RGB_COLORS
,
&
bits
,
0
,
0
);
Free
(
bmi
);
if
(
himl
->
uBitsPixel
<=
ILC_COLOR8
)
{
/* retrieve the default color map */
HBITMAP
tmp
=
CreateBitmap
(
1
,
1
,
1
,
1
,
NULL
);
GetDIBits
(
hdc
,
tmp
,
0
,
0
,
NULL
,
bmi
,
DIB_RGB_COLORS
);
DeleteObject
(
tmp
);
}
hbmNewBitmap
=
CreateDIBSection
(
hdc
,
bmi
,
DIB_RGB_COLORS
,
NULL
,
0
,
0
);
}
}
else
/*if (ilc == ILC_COLORDDB)*/
else
/*if (ilc == ILC_COLORDDB)*/
{
{
...
...
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