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
d8a85530
Commit
d8a85530
authored
Oct 31, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipCloneImage for metafiles with a handle.
parent
0cbec550
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
image.c
dlls/gdiplus/image.c
+32
-2
metafile.c
dlls/gdiplus/tests/metafile.c
+24
-0
No files found.
dlls/gdiplus/image.c
View file @
d8a85530
...
...
@@ -1382,10 +1382,40 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
return
stat
;
}
else
if
(
image
->
type
==
ImageTypeMetafile
&&
((
GpMetafile
*
)
image
)
->
hemf
)
{
GpMetafile
*
result
,
*
metafile
;
metafile
=
(
GpMetafile
*
)
image
;
result
=
GdipAlloc
(
sizeof
(
*
result
));
if
(
!
result
)
return
OutOfMemory
;
result
->
image
.
type
=
ImageTypeMetafile
;
result
->
image
.
format
=
image
->
format
;
result
->
image
.
flags
=
image
->
flags
;
result
->
image
.
frame_count
=
1
;
result
->
image
.
xres
=
image
->
xres
;
result
->
image
.
yres
=
image
->
yres
;
result
->
bounds
=
metafile
->
bounds
;
result
->
unit
=
metafile
->
unit
;
result
->
metafile_type
=
metafile
->
metafile_type
;
result
->
hemf
=
CopyEnhMetaFileW
(
metafile
->
hemf
,
NULL
);
if
(
!
result
->
hemf
)
{
GdipFree
(
result
);
return
OutOfMemory
;
}
*
cloneImage
=
&
result
->
image
;
return
Ok
;
}
else
{
ERR
(
"GpImage with no IPicture or bitmap?!
\n
"
);
return
NotImplemented
;
WARN
(
"GpImage with no image data (metafile in wrong state?)
\n
"
);
return
InvalidParameter
;
}
}
...
...
dlls/gdiplus/tests/metafile.c
View file @
d8a85530
...
...
@@ -474,6 +474,7 @@ static void test_emfonly(void)
{
GpStatus
stat
;
GpMetafile
*
metafile
;
GpImage
*
clone
;
GpGraphics
*
graphics
;
HDC
hdc
,
metafile_dc
;
HENHMETAFILE
hemf
;
...
...
@@ -560,6 +561,29 @@ static void test_emfonly(void)
expect
(
Ok
,
stat
);
expect
(
0xff0000ff
,
color
);
stat
=
GdipCloneImage
((
GpImage
*
)
metafile
,
&
clone
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapSetPixel
(
bitmap
,
50
,
50
,
0
);
expect
(
Ok
,
stat
);
stat
=
GdipDrawImagePointsRect
(
graphics
,
clone
,
dst_points
,
3
,
0
.
0
,
0
.
0
,
100
.
0
,
100
.
0
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
Ok
,
stat
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
15
,
15
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0
,
color
);
stat
=
GdipBitmapGetPixel
(
bitmap
,
50
,
50
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0xff0000ff
,
color
);
GdipDisposeImage
(
clone
);
}
stat
=
GdipDeleteGraphics
(
graphics
);
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