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
3d696d93
Commit
3d696d93
authored
Sep 23, 1999
by
Francois Boisvert
Committed by
Alexandre Julliard
Sep 23, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CreateDIBitmap creates a monochrome bitmap only when the first color of the
colormap is black followed by white. Otherwise it creates a color bitmap.
parent
5a3505c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
dib.c
objects/dib.c
+11
-5
No files found.
objects/dib.c
View file @
3d696d93
...
...
@@ -800,7 +800,7 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
/* Check if we should create a monochrome or color bitmap. */
/* We create a monochrome bitmap only if it has exactly 2 */
/* colors, which are
either black or
white, nothing else. */
/* colors, which are
black followed by
white, nothing else. */
/* In all other cases, we create a color bitmap. */
if
(
bpp
!=
1
)
fColor
=
TRUE
;
...
...
@@ -812,23 +812,29 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
{
RGBQUAD
*
rgb
=
data
->
bmiColors
;
DWORD
col
=
RGB
(
rgb
->
rgbRed
,
rgb
->
rgbGreen
,
rgb
->
rgbBlue
);
if
((
col
==
RGB
(
0
,
0
,
0
))
||
(
col
==
RGB
(
0xff
,
0xff
,
0xff
)))
/* Check if the first color of the colormap is black */
if
((
col
==
RGB
(
0
,
0
,
0
)))
{
rgb
++
;
col
=
RGB
(
rgb
->
rgbRed
,
rgb
->
rgbGreen
,
rgb
->
rgbBlue
);
fColor
=
((
col
!=
RGB
(
0
,
0
,
0
))
&&
(
col
!=
RGB
(
0xff
,
0xff
,
0xff
)));
/* If the second color is white, create a monochrome bitmap */
fColor
=
(
col
!=
RGB
(
0xff
,
0xff
,
0xff
));
}
/* Note : If the first color of the colormap is white
followed by black, we have to create a color bitmap.
If we don't the white will be displayed in black later on!*/
else
fColor
=
TRUE
;
}
else
if
(
data
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPCOREHEADER
))
{
RGBTRIPLE
*
rgb
=
((
BITMAPCOREINFO
*
)
data
)
->
bmciColors
;
DWORD
col
=
RGB
(
rgb
->
rgbtRed
,
rgb
->
rgbtGreen
,
rgb
->
rgbtBlue
);
if
((
col
==
RGB
(
0
,
0
,
0
))
||
(
col
==
RGB
(
0xff
,
0xff
,
0xff
))
)
if
((
col
==
RGB
(
0
,
0
,
0
)))
{
rgb
++
;
col
=
RGB
(
rgb
->
rgbtRed
,
rgb
->
rgbtGreen
,
rgb
->
rgbtBlue
);
fColor
=
(
(
col
!=
RGB
(
0
,
0
,
0
))
&&
(
col
!=
RGB
(
0xff
,
0xff
,
0xff
)
));
fColor
=
(
col
!=
RGB
(
0xff
,
0xff
,
0xff
));
}
else
fColor
=
TRUE
;
}
...
...
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