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
25dcd43e
Commit
25dcd43e
authored
Dec 12, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Support reading image data from device-dependent bitmaps.
parent
3424dac3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
image.c
dlls/gdiplus/image.c
+44
-1
No files found.
dlls/gdiplus/image.c
View file @
25dcd43e
...
...
@@ -2721,7 +2721,50 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
}
else
{
FIXME
(
"can only get image data from DIB sections
\n
"
);
HDC
hdc
;
HBITMAP
oldhbm
;
BITMAPINFO
*
pbmi
;
INT
src_height
,
dst_stride
;
BYTE
*
dst_bits
;
hdc
=
CreateCompatibleDC
(
NULL
);
oldhbm
=
SelectObject
(
hdc
,
hbm
);
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
if
(
pbmi
)
{
pbmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
pbmi
->
bmiHeader
.
biBitCount
=
0
;
GetDIBits
(
hdc
,
hbm
,
0
,
0
,
NULL
,
pbmi
,
DIB_RGB_COLORS
);
src_height
=
abs
(
pbmi
->
bmiHeader
.
biHeight
);
if
(
pbmi
->
bmiHeader
.
biHeight
>
0
)
{
dst_bits
=
(
BYTE
*
)
lockeddata
.
Scan0
+
lockeddata
.
Stride
*
(
src_height
-
1
);
dst_stride
=
-
lockeddata
.
Stride
;
}
else
{
dst_bits
=
lockeddata
.
Scan0
;
dst_stride
=
lockeddata
.
Stride
;
}
for
(
y
=
0
;
y
<
src_height
;
y
++
)
{
GetDIBits
(
hdc
,
hbm
,
y
,
1
,
dst_bits
+
dst_stride
*
y
,
pbmi
,
DIB_RGB_COLORS
);
}
GdipFree
(
pbmi
);
}
else
retval
=
OutOfMemory
;
SelectObject
(
hdc
,
oldhbm
);
DeleteDC
(
hdc
);
}
GdipBitmapUnlockBits
(
*
bitmap
,
&
lockeddata
);
...
...
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