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
1d8ef194
Commit
1d8ef194
authored
Aug 03, 2001
by
Andreas Mohr
Committed by
Alexandre Julliard
Aug 03, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DIB_GetBitmapInfo didn't recognize BITMAPV4/5HEADER.
parent
bb72c3d5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
3 deletions
+40
-3
dib.c
objects/dib.c
+40
-3
No files found.
objects/dib.c
View file @
1d8ef194
...
...
@@ -88,7 +88,8 @@ int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse )
* DIB_GetBitmapInfo
*
* Get the info from a bitmap header.
* Return 1 for INFOHEADER, 0 for COREHEADER, -1 for error.
* Return 1 for INFOHEADER, 0 for COREHEADER,
* 4 for V4HEADER, 5 for V5HEADER, -1 for error.
*/
int
DIB_GetBitmapInfo
(
const
BITMAPINFOHEADER
*
header
,
DWORD
*
width
,
int
*
height
,
WORD
*
bpp
,
WORD
*
compr
)
...
...
@@ -110,7 +111,25 @@ int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width,
*
compr
=
0
;
return
0
;
}
WARN
(
"(%ld): wrong size for header
\n
"
,
header
->
biSize
);
if
(
header
->
biSize
==
sizeof
(
BITMAPV4HEADER
))
{
BITMAPV4HEADER
*
v4hdr
=
(
BITMAPV4HEADER
*
)
header
;
*
width
=
v4hdr
->
bV4Width
;
*
height
=
v4hdr
->
bV4Height
;
*
bpp
=
v4hdr
->
bV4BitCount
;
*
compr
=
v4hdr
->
bV4Compression
;
return
4
;
}
if
(
header
->
biSize
==
sizeof
(
BITMAPV5HEADER
))
{
BITMAPV5HEADER
*
v5hdr
=
(
BITMAPV5HEADER
*
)
header
;
*
width
=
v5hdr
->
bV5Width
;
*
height
=
v5hdr
->
bV5Height
;
*
bpp
=
v5hdr
->
bV5BitCount
;
*
compr
=
v5hdr
->
bV5Compression
;
return
5
;
}
ERR
(
"(%ld): unknown/wrong size for header
\n
"
,
header
->
biSize
);
return
-
1
;
}
...
...
@@ -825,9 +844,27 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
}
else
fColor
=
TRUE
;
}
else
if
(
data
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPV4HEADER
))
{
/* FIXME: correct ? */
RGBQUAD
*
rgb
=
data
->
bmiColors
;
DWORD
col
=
RGB
(
rgb
->
rgbRed
,
rgb
->
rgbGreen
,
rgb
->
rgbBlue
);
/* 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
);
/* 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
{
WARN
(
"(%ld): wrong
size for data
\n
"
,
ERR
(
"(%ld): wrong/unknown
size for data
\n
"
,
data
->
bmiHeader
.
biSize
);
return
0
;
}
...
...
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