Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5fd16dde
Commit
5fd16dde
authored
Mar 12, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipCreateMetafileFromEmf.
parent
4b058e6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
41 deletions
+52
-41
graphics.c
dlls/gdiplus/graphics.c
+52
-41
No files found.
dlls/gdiplus/graphics.c
View file @
5fd16dde
...
...
@@ -2000,47 +2000,19 @@ GpStatus WINGDIPAPI GdipCreateFromHWNDICM(HWND hwnd, GpGraphics **graphics)
GpStatus
WINGDIPAPI
GdipCreateMetafileFromEmf
(
HENHMETAFILE
hemf
,
BOOL
delete
,
GpMetafile
**
metafile
)
{
static
int
calls
;
TRACE
(
"(%p,%i,%p)
\n
"
,
hemf
,
delete
,
metafile
);
if
(
!
hemf
||
!
metafile
)
return
InvalidParameter
;
if
(
!
(
calls
++
))
FIXME
(
"not implemented
\n
"
);
return
NotImplemented
;
}
GpStatus
WINGDIPAPI
GdipCreateMetafileFromWmf
(
HMETAFILE
hwmf
,
BOOL
delete
,
GDIPCONST
WmfPlaceableFileHeader
*
placeable
,
GpMetafile
**
metafile
)
{
IStream
*
stream
=
NULL
;
UINT
read
;
BYTE
*
copy
;
HENHMETAFILE
hemf
;
ENHMETAHEADER
*
copy
;
GpStatus
retval
=
Ok
;
TRACE
(
"(%p,
%d, %p, %p)
\n
"
,
hwmf
,
delete
,
placeabl
e
,
metafile
);
TRACE
(
"(%p,
%i,%p)
\n
"
,
hemf
,
delet
e
,
metafile
);
if
(
!
h
wmf
||
!
metafile
||
!
placeab
le
)
if
(
!
h
emf
||
!
metafi
le
)
return
InvalidParameter
;
*
metafile
=
NULL
;
read
=
GetMetaFileBitsEx
(
hwmf
,
0
,
NULL
);
if
(
!
read
)
return
GenericError
;
copy
=
GdipAlloc
(
read
);
GetMetaFileBitsEx
(
hwmf
,
read
,
copy
);
hemf
=
SetWinMetaFileBits
(
read
,
copy
,
NULL
,
NULL
);
GdipFree
(
copy
);
read
=
GetEnhMetaFileBits
(
hemf
,
0
,
NULL
);
copy
=
GdipAlloc
(
read
);
GetEnhMetaFileBits
(
hemf
,
read
,
copy
);
DeleteEnhMetaFile
(
hemf
);
GetEnhMetaFileBits
(
hemf
,
read
,
(
BYTE
*
)
copy
);
if
(
CreateStreamOnHGlobal
(
copy
,
TRUE
,
&
stream
)
!=
S_OK
){
ERR
(
"could not make stream
\n
"
);
...
...
@@ -2069,18 +2041,16 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
(
*
metafile
)
->
image
.
palette_count
=
0
;
(
*
metafile
)
->
image
.
palette_size
=
0
;
(
*
metafile
)
->
image
.
palette_entries
=
NULL
;
(
*
metafile
)
->
image
.
xres
=
(
REAL
)
placeable
->
Inch
;
(
*
metafile
)
->
image
.
yres
=
(
REAL
)
placeable
->
Inch
;
(
*
metafile
)
->
bounds
.
X
=
((
REAL
)
placeable
->
BoundingBox
.
Left
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Y
=
((
REAL
)
placeable
->
BoundingBox
.
Top
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Width
=
((
REAL
)
(
placeable
->
BoundingBox
.
Right
-
placeable
->
BoundingBox
.
Left
));
(
*
metafile
)
->
bounds
.
Height
=
((
REAL
)
(
placeable
->
BoundingBox
.
Bottom
-
placeable
->
BoundingBox
.
Top
));
(
*
metafile
)
->
image
.
xres
=
(
REAL
)
copy
->
szlDevice
.
cx
;
(
*
metafile
)
->
image
.
yres
=
(
REAL
)
copy
->
szlDevice
.
cy
;
(
*
metafile
)
->
bounds
.
X
=
(
REAL
)
copy
->
rclBounds
.
left
;
(
*
metafile
)
->
bounds
.
Y
=
(
REAL
)
copy
->
rclBounds
.
top
;
(
*
metafile
)
->
bounds
.
Width
=
(
REAL
)(
copy
->
rclBounds
.
right
-
copy
->
rclBounds
.
left
);
(
*
metafile
)
->
bounds
.
Height
=
(
REAL
)(
copy
->
rclBounds
.
bottom
-
copy
->
rclBounds
.
top
);
(
*
metafile
)
->
unit
=
UnitPixel
;
if
(
delete
)
Delete
MetaFile
(
hw
mf
);
Delete
EnhMetaFile
(
he
mf
);
TRACE
(
"<-- %p
\n
"
,
*
metafile
);
...
...
@@ -2091,6 +2061,47 @@ err:
return
retval
;
}
GpStatus
WINGDIPAPI
GdipCreateMetafileFromWmf
(
HMETAFILE
hwmf
,
BOOL
delete
,
GDIPCONST
WmfPlaceableFileHeader
*
placeable
,
GpMetafile
**
metafile
)
{
UINT
read
;
BYTE
*
copy
;
HENHMETAFILE
hemf
;
GpStatus
retval
=
Ok
;
TRACE
(
"(%p, %d, %p, %p)
\n
"
,
hwmf
,
delete
,
placeable
,
metafile
);
if
(
!
hwmf
||
!
metafile
||
!
placeable
)
return
InvalidParameter
;
*
metafile
=
NULL
;
read
=
GetMetaFileBitsEx
(
hwmf
,
0
,
NULL
);
if
(
!
read
)
return
GenericError
;
copy
=
GdipAlloc
(
read
);
GetMetaFileBitsEx
(
hwmf
,
read
,
copy
);
hemf
=
SetWinMetaFileBits
(
read
,
copy
,
NULL
,
NULL
);
GdipFree
(
copy
);
retval
=
GdipCreateMetafileFromEmf
(
hemf
,
FALSE
,
metafile
);
if
(
retval
==
Ok
)
{
(
*
metafile
)
->
image
.
xres
=
(
REAL
)
placeable
->
Inch
;
(
*
metafile
)
->
image
.
yres
=
(
REAL
)
placeable
->
Inch
;
(
*
metafile
)
->
bounds
.
X
=
((
REAL
)
placeable
->
BoundingBox
.
Left
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Y
=
((
REAL
)
placeable
->
BoundingBox
.
Top
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Width
=
(
REAL
)(
placeable
->
BoundingBox
.
Right
-
placeable
->
BoundingBox
.
Left
);
(
*
metafile
)
->
bounds
.
Height
=
(
REAL
)(
placeable
->
BoundingBox
.
Bottom
-
placeable
->
BoundingBox
.
Top
);
if
(
delete
)
DeleteMetaFile
(
hwmf
);
}
return
retval
;
}
GpStatus
WINGDIPAPI
GdipCreateMetafileFromWmfFile
(
GDIPCONST
WCHAR
*
file
,
GDIPCONST
WmfPlaceableFileHeader
*
placeable
,
GpMetafile
**
metafile
)
{
...
...
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