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
1914f3ec
Commit
1914f3ec
authored
Sep 28, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Copy a DIB section as a DIB section in BITMAP_CopyBitmap.
parent
91d91afb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
bitmap.c
dlls/gdi32/bitmap.c
+32
-8
No files found.
dlls/gdi32/bitmap.c
View file @
1914f3ec
...
...
@@ -510,17 +510,41 @@ LONG WINAPI SetBitmapBits(
*/
HBITMAP
BITMAP_CopyBitmap
(
HBITMAP
hbitmap
)
{
HBITMAP
res
=
0
;
BITMAP
bm
;
HBITMAP
res
;
DIBSECTION
dib
;
DWORD
size
;
if
(
!
(
size
=
GetObjectW
(
hbitmap
,
sizeof
(
dib
),
&
dib
)))
return
0
;
if
(
!
GetObjectW
(
hbitmap
,
sizeof
(
bm
),
&
bm
))
return
0
;
res
=
CreateBitmapIndirect
(
&
bm
);
if
(
size
==
sizeof
(
DIBSECTION
))
{
void
*
bits
;
BITMAPINFO
*
bi
;
HDC
dc
=
CreateCompatibleDC
(
NULL
);
if
(
!
dc
)
return
0
;
if
(
!
(
bi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
))))
{
DeleteDC
(
dc
);
return
0
;
}
bi
->
bmiHeader
=
dib
.
dsBmih
;
/* Get the color table or the color masks */
GetDIBits
(
dc
,
hbitmap
,
0
,
0
,
NULL
,
bi
,
DIB_RGB_COLORS
);
res
=
CreateDIBSection
(
dc
,
bi
,
DIB_RGB_COLORS
,
&
bits
,
NULL
,
0
);
if
(
res
)
SetDIBits
(
dc
,
res
,
0
,
dib
.
dsBm
.
bmHeight
,
dib
.
dsBm
.
bmBits
,
bi
,
DIB_RGB_COLORS
);
HeapFree
(
GetProcessHeap
(),
0
,
bi
);
DeleteDC
(
dc
);
return
res
;
}
res
=
CreateBitmapIndirect
(
&
dib
.
dsBm
);
if
(
res
)
{
char
*
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bm
.
bmWidthBytes
*
bm
.
bmHeight
);
GetBitmapBits
(
hbitmap
,
bm
.
bmWidthBytes
*
bm
.
bmHeight
,
buf
);
SetBitmapBits
(
res
,
bm
.
bmWidthBytes
*
bm
.
bmHeight
,
buf
);
char
*
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dib
.
dsBm
.
bmWidthBytes
*
dib
.
dsBm
.
bmHeight
);
GetBitmapBits
(
hbitmap
,
dib
.
dsBm
.
bmWidthBytes
*
dib
.
dsBm
.
bmHeight
,
buf
);
SetBitmapBits
(
res
,
dib
.
dsBm
.
bmWidthBytes
*
dib
.
dsBm
.
bmHeight
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
return
res
;
...
...
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