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
636e60b6
Commit
636e60b6
authored
Mar 09, 2013
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Fix GdipCreateBitmapFromGraphics implementation.
parent
31575343
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
7 deletions
+60
-7
image.c
dlls/gdiplus/image.c
+7
-7
graphics.c
dlls/gdiplus/tests/graphics.c
+53
-0
No files found.
dlls/gdiplus/image.c
View file @
636e60b6
...
...
@@ -1595,12 +1595,9 @@ GpStatus WINGDIPAPI GdipConvertToEmfPlus(const GpGraphics* ref,
return
NotImplemented
;
}
/* FIXME: this should create a bitmap in the given size with the attributes
* (resolution etc.) of the graphics object */
GpStatus
WINGDIPAPI
GdipCreateBitmapFromGraphics
(
INT
width
,
INT
height
,
GpGraphics
*
target
,
GpBitmap
**
bitmap
)
{
static
int
calls
;
GpStatus
ret
;
TRACE
(
"(%d, %d, %p, %p)
\n
"
,
width
,
height
,
target
,
bitmap
);
...
...
@@ -1608,12 +1605,15 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height,
if
(
!
target
||
!
bitmap
)
return
InvalidParameter
;
if
(
!
(
calls
++
))
FIXME
(
"hacked stub
\n
"
);
ret
=
GdipCreateBitmapFromScan0
(
width
,
height
,
0
,
PixelFormat24bppRGB
,
ret
=
GdipCreateBitmapFromScan0
(
width
,
height
,
0
,
PixelFormat32bppPARGB
,
NULL
,
bitmap
);
if
(
ret
==
Ok
)
{
GdipGetDpiX
(
target
,
&
(
*
bitmap
)
->
image
.
xres
);
GdipGetDpiY
(
target
,
&
(
*
bitmap
)
->
image
.
yres
);
}
return
ret
;
}
...
...
dlls/gdiplus/tests/graphics.c
View file @
636e60b6
...
...
@@ -4282,6 +4282,58 @@ static void test_alpha_hdc(void)
DeleteDC
(
hdc
);
}
static
void
test_bitmapfromgraphics
(
void
)
{
GpStatus
stat
;
GpGraphics
*
graphics
=
NULL
;
HDC
hdc
=
GetDC
(
hwnd
);
GpBitmap
*
bitmap
=
NULL
;
PixelFormat
format
;
REAL
imageres
,
graphicsres
;
UINT
width
,
height
;
stat
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipCreateBitmapFromGraphics
(
12
,
13
,
NULL
,
&
bitmap
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateBitmapFromGraphics
(
12
,
13
,
graphics
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateBitmapFromGraphics
(
12
,
13
,
graphics
,
&
bitmap
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImagePixelFormat
((
GpImage
*
)
bitmap
,
&
format
);
expect
(
Ok
,
stat
);
expect
(
PixelFormat32bppPARGB
,
format
);
stat
=
GdipGetDpiX
(
graphics
,
&
graphicsres
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageHorizontalResolution
((
GpImage
*
)
bitmap
,
&
imageres
);
expect
(
Ok
,
stat
);
expectf
(
graphicsres
,
imageres
);
stat
=
GdipGetDpiY
(
graphics
,
&
graphicsres
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageVerticalResolution
((
GpImage
*
)
bitmap
,
&
imageres
);
expect
(
Ok
,
stat
);
expectf
(
graphicsres
,
imageres
);
stat
=
GdipGetImageWidth
((
GpImage
*
)
bitmap
,
&
width
);
expect
(
Ok
,
stat
);
expect
(
12
,
width
);
stat
=
GdipGetImageHeight
((
GpImage
*
)
bitmap
,
&
height
);
expect
(
Ok
,
stat
);
expect
(
13
,
height
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
START_TEST
(
graphics
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -4349,6 +4401,7 @@ START_TEST(graphics)
test_get_set_textrenderinghint
();
test_getdc_scaled
();
test_alpha_hdc
();
test_bitmapfromgraphics
();
GdiplusShutdown
(
gdiplusToken
);
DestroyWindow
(
hwnd
);
...
...
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