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
3ef75725
Commit
3ef75725
authored
Apr 10, 1999
by
Luc Tourangeau
Committed by
Alexandre Julliard
Apr 10, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that the bitmap is properly initialized when created with the
LR_CREATEDIBSECTION flag.
parent
9024526d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
44 deletions
+7
-44
bitmap.c
objects/bitmap.c
+7
-44
No files found.
objects/bitmap.c
View file @
3ef75725
...
...
@@ -20,50 +20,8 @@
#include "monitor.h"
#include "wine/winuser16.h"
/**********************************************************************/
BITMAP_DRIVER
*
BITMAP_Driver
=
NULL
;
/***********************************************************************
* BITMAP_GetPadding
*
* Return number of bytes to pad a scanline of 16-bit aligned Windows DDB data.
*/
INT
BITMAP_GetPadding
(
int
bmWidth
,
int
bpp
)
{
INT
pad
;
switch
(
bpp
)
{
case
1
:
pad
=
((
bmWidth
-
1
)
&
8
)
?
0
:
1
;
break
;
case
8
:
pad
=
(
2
-
(
bmWidth
&
1
))
&
1
;
break
;
case
24
:
pad
=
(
bmWidth
*
3
)
&
1
;
break
;
case
32
:
case
16
:
case
15
:
pad
=
0
;
/* we have 16bit alignment already */
break
;
case
4
:
if
(
!
(
bmWidth
&
3
))
pad
=
0
;
else
pad
=
((
4
-
(
bmWidth
&
3
))
+
1
)
/
2
;
break
;
default:
WARN
(
bitmap
,
"Unknown depth %d, please report.
\n
"
,
bpp
);
return
-
1
;
}
return
pad
;
}
/***********************************************************************
* BITMAP_GetWidthBytes
...
...
@@ -613,10 +571,15 @@ HBITMAP BITMAP_Load( HINSTANCE instance,LPCWSTR name, UINT loadflags )
pix
=
*
((
LPBYTE
)
info
+
DIB_BitmapInfoSize
(
info
,
DIB_RGB_COLORS
));
DIB_FixColorsToLoadflags
(
fix_info
,
loadflags
,
pix
);
if
((
hdc
=
GetDC
(
0
))
!=
0
)
{
if
(
loadflags
&
LR_CREATEDIBSECTION
)
char
*
bits
=
(
char
*
)
info
+
size
;
if
(
loadflags
&
LR_CREATEDIBSECTION
)
{
DIBSECTION
dib
;
hbitmap
=
CreateDIBSection
(
hdc
,
fix_info
,
DIB_RGB_COLORS
,
NULL
,
0
,
0
);
GetObjectA
(
hbitmap
,
sizeof
(
DIBSECTION
),
&
dib
);
SetDIBits
(
hdc
,
hbitmap
,
0
,
dib
.
dsBm
.
bmHeight
,
bits
,
info
,
DIB_RGB_COLORS
);
}
else
{
char
*
bits
=
(
char
*
)
info
+
size
;;
hbitmap
=
CreateDIBitmap
(
hdc
,
&
fix_info
->
bmiHeader
,
CBM_INIT
,
bits
,
fix_info
,
DIB_RGB_COLORS
);
}
...
...
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