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
7900947c
Commit
7900947c
authored
Mar 10, 2008
by
Nathan Beckmann
Committed by
Alexandre Julliard
Mar 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipSaveImageToFile via GdipSaveImageToStream.
Still need to implement saving the image based on the encoder parameter. Basic tests included.
parent
f4b4d03a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
1 deletion
+72
-1
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
image.c
dlls/gdiplus/image.c
+23
-0
image.c
dlls/gdiplus/tests/image.c
+48
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
7900947c
...
...
@@ -494,7 +494,7 @@
@ stub GdipSaveAdd
@ stub GdipSaveAddImage
@ stdcall GdipSaveGraphics(ptr ptr)
@ st
ub GdipSaveImageToFile
@ st
dcall GdipSaveImageToFile(ptr ptr ptr ptr)
@ stdcall GdipSaveImageToStream(ptr ptr ptr ptr)
@ stub GdipScaleLineTransform
@ stdcall GdipScaleMatrix(ptr long long long)
...
...
dlls/gdiplus/image.c
View file @
7900947c
...
...
@@ -811,6 +811,29 @@ GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage *image, PROPID propId)
return
NotImplemented
;
}
GpStatus
WINGDIPAPI
GdipSaveImageToFile
(
GpImage
*
image
,
GDIPCONST
WCHAR
*
filename
,
GDIPCONST
CLSID
*
clsidEncoder
,
GDIPCONST
EncoderParameters
*
encoderParams
)
{
GpStatus
stat
;
IStream
*
stream
;
if
(
!
image
||
!
filename
||
!
clsidEncoder
)
return
InvalidParameter
;
if
(
!
(
image
->
picture
))
return
InvalidParameter
;
stat
=
GdipCreateStreamOnFile
(
filename
,
GENERIC_WRITE
,
&
stream
);
if
(
stat
!=
Ok
)
return
GenericError
;
stat
=
GdipSaveImageToStream
(
image
,
stream
,
clsidEncoder
,
encoderParams
);
IStream_Release
(
stream
);
return
stat
;
}
GpStatus
WINGDIPAPI
GdipSaveImageToStream
(
GpImage
*
image
,
IStream
*
stream
,
GDIPCONST
CLSID
*
clsid
,
GDIPCONST
EncoderParameters
*
params
)
{
...
...
dlls/gdiplus/tests/image.c
View file @
7900947c
...
...
@@ -122,6 +122,53 @@ static void test_LoadingImages(void)
expect
(
InvalidParameter
,
stat
);
}
static
void
test_SavingImages
(
void
)
{
GpStatus
stat
;
GpBitmap
*
bm
;
UINT
n
;
UINT
s
;
ImageCodecInfo
*
codecs
;
static
const
WCHAR
filename
[]
=
{
'a'
,
'.'
,
'b'
,
'm'
,
'p'
,
0
};
codecs
=
NULL
;
stat
=
GdipSaveImageToFile
(
0
,
0
,
0
,
0
);
expect
(
InvalidParameter
,
stat
);
bm
=
NULL
;
stat
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
if
(
!
bm
)
return
;
/* invalid params */
stat
=
GdipSaveImageToFile
((
GpImage
*
)
bm
,
0
,
0
,
0
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSaveImageToFile
((
GpImage
*
)
bm
,
filename
,
0
,
0
);
expect
(
InvalidParameter
,
stat
);
/* this should succeed */
stat
=
GdipGetImageEncodersSize
(
&
n
,
&
s
);
if
(
stat
!=
Ok
||
n
==
0
)
goto
cleanup
;
codecs
=
GdipAlloc
(
s
);
if
(
!
codecs
)
goto
cleanup
;
stat
=
GdipGetImageEncoders
(
n
,
s
,
codecs
);
if
(
stat
!=
Ok
)
goto
cleanup
;
stat
=
GdipSaveImageToFile
((
GpImage
*
)
bm
,
filename
,
&
codecs
[
0
].
Clsid
,
0
);
expect
(
stat
,
Ok
);
cleanup:
if
(
codecs
)
GdipFree
(
codecs
);
if
(
bm
)
GdipDisposeImage
((
GpImage
*
)
bm
);
}
static
void
test_encoders
(
void
)
{
GpStatus
stat
;
...
...
@@ -287,6 +334,7 @@ START_TEST(image)
test_Scan0
();
test_GetImageDimension
();
test_LoadingImages
();
test_SavingImages
();
test_encoders
();
test_LockBits
();
...
...
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