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
b6c52ce9
Commit
b6c52ce9
authored
Sep 05, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipCloneImage.
parent
bff1678f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
9 deletions
+45
-9
image.c
dlls/gdiplus/image.c
+42
-3
image.c
dlls/gdiplus/tests/image.c
+3
-6
No files found.
dlls/gdiplus/image.c
View file @
b6c52ce9
...
...
@@ -242,11 +242,50 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
GpStatus
WINGDIPAPI
GdipCloneImage
(
GpImage
*
image
,
GpImage
**
cloneImage
)
{
if
(
!
(
image
&&
cloneImage
))
return
InvalidParameter
;
IStream
*
stream
;
HRESULT
hr
;
INT
size
;
FIXME
(
"stub:
%p, %p
\n
"
,
image
,
cloneImage
);
TRACE
(
"
%p, %p
\n
"
,
image
,
cloneImage
);
return
NotImplemented
;
if
(
!
image
||
!
cloneImage
)
return
InvalidParameter
;
hr
=
CreateStreamOnHGlobal
(
0
,
TRUE
,
&
stream
);
if
(
FAILED
(
hr
))
return
GenericError
;
*
cloneImage
=
GdipAlloc
(
sizeof
(
GpImage
));
if
(
!*
cloneImage
)
{
IStream_Release
(
stream
);
return
OutOfMemory
;
}
(
*
cloneImage
)
->
type
=
image
->
type
;
(
*
cloneImage
)
->
flags
=
image
->
flags
;
hr
=
IPicture_SaveAsFile
(
image
->
picture
,
stream
,
FALSE
,
&
size
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to save image on stream
\n
"
);
goto
out
;
}
hr
=
OleLoadPicture
(
stream
,
size
,
FALSE
,
&
IID_IPicture
,
(
LPVOID
*
)
&
(
*
cloneImage
)
->
picture
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to load image from stream
\n
"
);
goto
out
;
}
IStream_Release
(
stream
);
return
Ok
;
out:
IStream_Release
(
stream
);
GdipFree
(
*
cloneImage
);
*
cloneImage
=
NULL
;
return
GenericError
;
}
GpStatus
WINGDIPAPI
GdipCreateBitmapFromFile
(
GDIPCONST
WCHAR
*
filename
,
...
...
dlls/gdiplus/tests/image.c
View file @
b6c52ce9
...
...
@@ -504,22 +504,19 @@ static void test_GdipCloneImage(void)
/* Create an image, clone it, delete the original, make sure the copy works */
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
todo_wine
{
image_src
=
((
GpImage
*
)
bm
);
stat
=
GdipCloneImage
(
image_src
,
&
image_dest
);
expect
(
Ok
,
stat
);
}
stat
=
GdipDisposeImage
((
GpImage
*
)
bm
);
expect
(
Ok
,
stat
);
todo_wine
{
stat
=
GdipGetImageBounds
(
image_dest
,
&
rectF
,
&
unit
);
expect
(
Ok
,
stat
);
stat
=
GdipDisposeImage
(
image_dest
);
expect
(
Ok
,
stat
);
}
}
START_TEST
(
image
)
{
...
...
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