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
81a294f7
Commit
81a294f7
authored
Jan 23, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Using DIB APIs to convert a DDB to monochrome is wrong, do it differently.
parent
d857d0f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
13 deletions
+27
-13
cursoricon.c
dlls/user32/cursoricon.c
+27
-13
No files found.
dlls/user32/cursoricon.c
View file @
81a294f7
...
...
@@ -1846,8 +1846,6 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo)
sizeof
(
CURSORICONINFO
)
+
sizeXor
+
sizeAnd
);
if
(
hObj
)
{
HDC
hdc
;
BITMAPINFO
bi
;
CURSORICONINFO
*
info
;
info
=
(
CURSORICONINFO
*
)
GlobalLock16
(
hObj
);
...
...
@@ -1884,18 +1882,34 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo)
/* Transfer the bitmap bits to the CURSORICONINFO structure */
/* Some apps pass a color bitmap as a mask, convert it to b/w */
hdc
=
GetDC
(
0
);
memset
(
&
bi
,
0
,
sizeof
(
bi
)
);
bi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
bi
.
bmiHeader
.
biWidth
=
bmpAnd
.
bmWidth
;
bi
.
bmiHeader
.
biHeight
=
bmpAnd
.
bmHeight
;
bi
.
bmiHeader
.
biPlanes
=
1
;
bi
.
bmiHeader
.
biBitCount
=
1
;
bi
.
bmiHeader
.
biCompression
=
BI_RGB
;
bi
.
bmiHeader
.
biSizeImage
=
sizeAnd
;
GetDIBits
(
hdc
,
iconinfo
->
hbmMask
,
0
,
bmpAnd
.
bmHeight
,
(
char
*
)(
info
+
1
),
&
bi
,
DIB_RGB_COLORS
);
ReleaseDC
(
0
,
hdc
);
if
(
bmpAnd
.
bmBitsPixel
==
1
)
{
GetBitmapBits
(
iconinfo
->
hbmMask
,
sizeAnd
,
(
char
*
)(
info
+
1
)
);
}
else
{
HDC
hdc
,
hdc_mem
;
HBITMAP
hbmp_old
,
hbmp_mem_old
,
hbmp_mono
;
hdc
=
GetDC
(
0
);
hdc_mem
=
CreateCompatibleDC
(
hdc
);
hbmp_mono
=
CreateBitmap
(
bmpAnd
.
bmWidth
,
bmpAnd
.
bmHeight
,
1
,
1
,
NULL
);
hbmp_old
=
SelectObject
(
hdc
,
iconinfo
->
hbmMask
);
hbmp_mem_old
=
SelectObject
(
hdc_mem
,
hbmp_mono
);
BitBlt
(
hdc_mem
,
0
,
0
,
bmpAnd
.
bmWidth
,
bmpAnd
.
bmHeight
,
hdc
,
0
,
0
,
SRCCOPY
);
SelectObject
(
hdc
,
hbmp_old
);
SelectObject
(
hdc_mem
,
hbmp_mem_old
);
DeleteDC
(
hdc_mem
);
ReleaseDC
(
0
,
hdc
);
GetBitmapBits
(
hbmp_mono
,
sizeAnd
,
(
char
*
)(
info
+
1
)
);
DeleteObject
(
hbmp_mono
);
}
if
(
iconinfo
->
hbmColor
)
GetBitmapBits
(
iconinfo
->
hbmColor
,
sizeXor
,
(
char
*
)(
info
+
1
)
+
sizeAnd
);
GlobalUnlock16
(
hObj
);
}
...
...
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