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
1735a724
Commit
1735a724
authored
Oct 30, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Use reference device to determine created metafile resolution.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
233f1c1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
metafile.c
dlls/gdiplus/metafile.c
+8
-4
metafile.c
dlls/gdiplus/tests/metafile.c
+12
-12
No files found.
dlls/gdiplus/metafile.c
View file @
1735a724
...
...
@@ -193,6 +193,7 @@ GpStatus WINGDIPAPI GdipRecordMetafile(HDC hdc, EmfType type, GDIPCONST GpRectF
MetafileFrameUnit
frameUnit
,
GDIPCONST
WCHAR
*
desc
,
GpMetafile
**
metafile
)
{
HDC
record_dc
;
REAL
dpix
,
dpiy
;
REAL
framerect_factor_x
,
framerect_factor_y
;
RECT
rc
;
GpStatus
stat
;
...
...
@@ -208,11 +209,14 @@ GpStatus WINGDIPAPI GdipRecordMetafile(HDC hdc, EmfType type, GDIPCONST GpRectF
return
NotImplemented
;
}
dpix
=
(
REAL
)
GetDeviceCaps
(
hdc
,
HORZRES
)
/
GetDeviceCaps
(
hdc
,
HORZSIZE
)
*
25
.
4
;
dpiy
=
(
REAL
)
GetDeviceCaps
(
hdc
,
VERTRES
)
/
GetDeviceCaps
(
hdc
,
VERTSIZE
)
*
25
.
4
;
switch
(
frameUnit
)
{
case
MetafileFrameUnitPixel
:
framerect_factor_x
=
2540
.
0
/
GetDeviceCaps
(
hdc
,
LOGPIXELSX
)
;
framerect_factor_y
=
2540
.
0
/
GetDeviceCaps
(
hdc
,
LOGPIXELSY
)
;
framerect_factor_x
=
2540
.
0
/
dpix
;
framerect_factor_y
=
2540
.
0
/
dpiy
;
break
;
case
MetafileFrameUnitPoint
:
framerect_factor_x
=
framerect_factor_y
=
2540
.
0
/
72
.
0
;
...
...
@@ -254,8 +258,8 @@ GpStatus WINGDIPAPI GdipRecordMetafile(HDC hdc, EmfType type, GDIPCONST GpRectF
(
*
metafile
)
->
image
.
picture
=
NULL
;
(
*
metafile
)
->
image
.
flags
=
ImageFlagsNone
;
(
*
metafile
)
->
image
.
palette
=
NULL
;
(
*
metafile
)
->
image
.
xres
=
72
.
0
;
(
*
metafile
)
->
image
.
yres
=
72
.
0
;
(
*
metafile
)
->
image
.
xres
=
dpix
;
(
*
metafile
)
->
image
.
yres
=
dpiy
;
(
*
metafile
)
->
bounds
=
*
frameRect
;
(
*
metafile
)
->
unit
=
frameUnit
;
(
*
metafile
)
->
metafile_type
=
type
;
...
...
dlls/gdiplus/tests/metafile.c
View file @
1735a724
...
...
@@ -373,10 +373,10 @@ static void test_empty(void)
expect
(
U
(
header
).
EmfHeader
.
nBytes
,
header
.
Size
);
ok
(
header
.
Version
==
0xdbc01001
||
header
.
Version
==
0xdbc01002
,
"Unexpected version %x
\n
"
,
header
.
Version
);
expect
(
1
,
header
.
EmfPlusFlags
);
/* reference device was display, not printer */
todo_wine
expectf
(
xres
,
header
.
DpiX
);
todo_wine
expectf
(
xres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cx
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cx
*
25
.
4
);
todo_wine
expectf
(
yres
,
header
.
DpiY
);
todo_wine
expectf
(
yres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cy
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cy
*
25
.
4
);
expectf
(
xres
,
header
.
DpiX
);
expectf
(
xres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cx
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cx
*
25
.
4
);
expectf
(
yres
,
header
.
DpiY
);
expectf
(
yres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cy
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cy
*
25
.
4
);
expect
(
0
,
header
.
X
);
expect
(
0
,
header
.
Y
);
expect
(
100
,
header
.
Width
);
...
...
@@ -391,8 +391,8 @@ static void test_empty(void)
expect
(
-
1
,
U
(
header
).
EmfHeader
.
rclBounds
.
bottom
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
left
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
top
);
todo_wine
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
right
*
xres
/
2540
.
0
,
2
.
0
);
todo_wine
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
bottom
*
yres
/
2540
.
0
,
2
.
0
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
right
*
xres
/
2540
.
0
,
2
.
0
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
bottom
*
yres
/
2540
.
0
,
2
.
0
);
stat
=
GdipCreateMetafileFromEmf
(
hemf
,
TRUE
,
&
metafile
);
expect
(
Ok
,
stat
);
...
...
@@ -720,10 +720,10 @@ static void test_emfonly(void)
expect
(
U
(
header
).
EmfHeader
.
nBytes
,
header
.
Size
);
expect
(
0x10000
,
header
.
Version
);
expect
(
0
,
header
.
EmfPlusFlags
);
todo_wine
expectf
(
xres
,
header
.
DpiX
);
todo_wine
expectf
(
xres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cx
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cx
*
25
.
4
);
todo_wine
expectf
(
yres
,
header
.
DpiY
);
todo_wine
expectf
(
yres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cy
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cy
*
25
.
4
);
expectf
(
xres
,
header
.
DpiX
);
expectf
(
xres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cx
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cx
*
25
.
4
);
expectf
(
yres
,
header
.
DpiY
);
expectf
(
yres
,
U
(
header
).
EmfHeader
.
szlDevice
.
cy
/
(
REAL
)
U
(
header
).
EmfHeader
.
szlMillimeters
.
cy
*
25
.
4
);
expect
(
0
,
header
.
X
);
expect
(
0
,
header
.
Y
);
expect
(
100
,
header
.
Width
);
...
...
@@ -738,8 +738,8 @@ static void test_emfonly(void)
expect
(
74
,
U
(
header
).
EmfHeader
.
rclBounds
.
bottom
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
left
);
expect
(
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
top
);
todo_wine
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
right
*
xres
/
2540
.
0
,
2
.
0
);
todo_wine
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
bottom
*
yres
/
2540
.
0
,
2
.
0
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
right
*
xres
/
2540
.
0
,
2
.
0
);
expectf_
(
100
.
0
,
U
(
header
).
EmfHeader
.
rclFrame
.
bottom
*
yres
/
2540
.
0
,
2
.
0
);
stat
=
GdipCreateMetafileFromEmf
(
hemf
,
TRUE
,
&
metafile
);
expect
(
Ok
,
stat
);
...
...
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