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
f71cb580
Commit
f71cb580
authored
Dec 26, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add test for image resolution functions.
parent
c38d3342
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
image.c
dlls/gdiplus/tests/image.c
+64
-0
No files found.
dlls/gdiplus/tests/image.c
View file @
f71cb580
...
...
@@ -889,6 +889,69 @@ static void test_createfromwmf(void)
GdipDisposeImage
(
img
);
}
static
void
test_resolution
(
void
)
{
GpStatus
stat
;
GpBitmap
*
bitmap
;
REAL
res
=-
1
.
0
;
HDC
screendc
;
int
screenxres
,
screenyres
;
/* create Bitmap */
stat
=
GdipCreateBitmapFromScan0
(
1
,
1
,
32
,
PixelFormat24bppRGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
stat
);
/* test invalid values */
stat
=
GdipGetImageHorizontalResolution
(
NULL
,
&
res
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetImageHorizontalResolution
((
GpImage
*
)
bitmap
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetImageVerticalResolution
(
NULL
,
&
res
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetImageVerticalResolution
((
GpImage
*
)
bitmap
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipBitmapSetResolution
(
NULL
,
96
.
0
,
96
.
0
);
todo_wine
expect
(
InvalidParameter
,
stat
);
stat
=
GdipBitmapSetResolution
(
bitmap
,
0
.
0
,
0
.
0
);
todo_wine
expect
(
InvalidParameter
,
stat
);
/* defaults to screen resolution */
screendc
=
GetDC
(
0
);
screenxres
=
GetDeviceCaps
(
screendc
,
LOGPIXELSX
);
screenyres
=
GetDeviceCaps
(
screendc
,
LOGPIXELSY
);
ReleaseDC
(
0
,
screendc
);
stat
=
GdipGetImageHorizontalResolution
((
GpImage
*
)
bitmap
,
&
res
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expectf
((
REAL
)
screenxres
,
res
);
stat
=
GdipGetImageVerticalResolution
((
GpImage
*
)
bitmap
,
&
res
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expectf
((
REAL
)
screenyres
,
res
);
/* test changing the resolution */
stat
=
GdipBitmapSetResolution
(
bitmap
,
screenxres
*
2
.
0
,
screenyres
*
3
.
0
);
todo_wine
expect
(
Ok
,
stat
);
stat
=
GdipGetImageHorizontalResolution
((
GpImage
*
)
bitmap
,
&
res
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expectf
(
screenxres
*
2
.
0
,
res
);
stat
=
GdipGetImageVerticalResolution
((
GpImage
*
)
bitmap
,
&
res
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expectf
(
screenyres
*
3
.
0
,
res
);
stat
=
GdipDisposeImage
((
GpImage
*
)
bitmap
);
expect
(
Ok
,
stat
);
}
static
void
test_createhbitmap
(
void
)
{
GpStatus
stat
;
...
...
@@ -1465,6 +1528,7 @@ START_TEST(image)
test_getrawformat
();
test_loadwmf
();
test_createfromwmf
();
test_resolution
();
test_createhbitmap
();
test_getsetpixel
();
test_palette
();
...
...
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