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
84d260ec
Commit
84d260ec
authored
Feb 27, 2008
by
Jon Yang
Committed by
Alexandre Julliard
Feb 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented and tested GdipGetImageDimension().
parent
81dadcb1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
1 deletion
+66
-1
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
image.c
dlls/gdiplus/image.c
+31
-0
image.c
dlls/gdiplus/tests/image.c
+33
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
84d260ec
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
@ stdcall GdipGetImageBounds(ptr ptr ptr)
@ stdcall GdipGetImageBounds(ptr ptr ptr)
@ stub GdipGetImageDecoders
@ stub GdipGetImageDecoders
@ stub GdipGetImageDecodersSize
@ stub GdipGetImageDecodersSize
@ st
ub GdipGetImageDimension
@ st
dcall GdipGetImageDimension(ptr ptr ptr)
@ stub GdipGetImageEncoders
@ stub GdipGetImageEncoders
@ stub GdipGetImageEncodersSize
@ stub GdipGetImageEncodersSize
@ stub GdipGetImageFlags
@ stub GdipGetImageFlags
...
...
dlls/gdiplus/image.c
View file @
84d260ec
...
@@ -463,6 +463,37 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
...
@@ -463,6 +463,37 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
return
Ok
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipGetImageDimension
(
GpImage
*
image
,
REAL
*
width
,
REAL
*
height
)
{
if
(
!
image
||
!
height
||
!
width
)
return
InvalidParameter
;
if
(
image
->
type
==
ImageTypeMetafile
){
HDC
hdc
=
GetDC
(
0
);
*
height
=
convert_unit
(
hdc
,
((
GpMetafile
*
)
image
)
->
unit
)
*
((
GpMetafile
*
)
image
)
->
bounds
.
Height
;
*
width
=
convert_unit
(
hdc
,
((
GpMetafile
*
)
image
)
->
unit
)
*
((
GpMetafile
*
)
image
)
->
bounds
.
Width
;
ReleaseDC
(
0
,
hdc
);
}
else
if
(
image
->
type
==
ImageTypeBitmap
){
*
height
=
((
GpBitmap
*
)
image
)
->
height
;
*
width
=
((
GpBitmap
*
)
image
)
->
width
;
}
else
{
*
height
=
ipicture_pixel_height
(
image
->
picture
);
*
width
=
ipicture_pixel_width
(
image
->
picture
);
}
TRACE
(
"returning (%f, %f)
\n
"
,
*
height
,
*
width
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetImageGraphicsContext
(
GpImage
*
image
,
GpStatus
WINGDIPAPI
GdipGetImageGraphicsContext
(
GpImage
*
image
,
GpGraphics
**
graphics
)
GpGraphics
**
graphics
)
{
{
...
...
dlls/gdiplus/tests/image.c
View file @
84d260ec
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "windows.h"
#include "windows.h"
#include "gdiplus.h"
#include "gdiplus.h"
#include "wine/test.h"
#include "wine/test.h"
#include <math.h>
#define expect(expected, got) ok(((UINT)got) == ((UINT)expected), "Expected %.8x, got %.8x\n", (UINT)expected, (UINT)got)
#define expect(expected, got) ok(((UINT)got) == ((UINT)expected), "Expected %.8x, got %.8x\n", (UINT)expected, (UINT)got)
...
@@ -73,6 +74,37 @@ static void test_Scan0(void)
...
@@ -73,6 +74,37 @@ static void test_Scan0(void)
expect
(
0xdeadbeef
,
bm
);
expect
(
0xdeadbeef
,
bm
);
}
}
static
void
test_GetImageDimension
(
void
)
{
GpBitmap
*
bm
;
GpStatus
stat
;
const
REAL
WIDTH
=
10
.
0
,
HEIGHT
=
20
.
0
;
REAL
w
,
h
;
bm
=
(
GpBitmap
*
)
0xdeadbeef
;
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
ok
((
GpBitmap
*
)
0xdeadbeef
!=
bm
,
"Expected bitmap to not be 0xdeadbeef
\n
"
);
ok
(
NULL
!=
bm
,
"Expected bitmap to not be NULL
\n
"
);
stat
=
GdipGetImageDimension
(
NULL
,
&
w
,
&
h
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetImageDimension
((
GpImage
*
)
bm
,
NULL
,
&
h
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetImageDimension
((
GpImage
*
)
bm
,
&
w
,
NULL
);
expect
(
InvalidParameter
,
stat
);
w
=
-
1
;
h
=
-
1
;
stat
=
GdipGetImageDimension
((
GpImage
*
)
bm
,
&
w
,
&
h
);
expect
(
Ok
,
stat
);
ok
(
fabs
(
WIDTH
-
w
)
<
0
.
0001
,
"Width wrong"
);
ok
(
fabs
(
HEIGHT
-
h
)
<
0
.
0001
,
"Height wrong"
);
GdipDisposeImage
((
GpImage
*
)
bm
);
}
START_TEST
(
image
)
START_TEST
(
image
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -86,6 +118,7 @@ START_TEST(image)
...
@@ -86,6 +118,7 @@ START_TEST(image)
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
test_Scan0
();
test_Scan0
();
test_GetImageDimension
();
GdiplusShutdown
(
gdiplusToken
);
GdiplusShutdown
(
gdiplusToken
);
}
}
include/gdiplusflat.h
View file @
84d260ec
...
@@ -114,6 +114,7 @@ GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL);
...
@@ -114,6 +114,7 @@ GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL);
GpStatus
WINGDIPAPI
GdipFillRectangleI
(
GpGraphics
*
,
GpBrush
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipFillRectangleI
(
GpGraphics
*
,
GpBrush
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipGetCompositingMode
(
GpGraphics
*
,
CompositingMode
*
);
GpStatus
WINGDIPAPI
GdipGetCompositingMode
(
GpGraphics
*
,
CompositingMode
*
);
GpStatus
WINGDIPAPI
GdipGetCompositingQuality
(
GpGraphics
*
,
CompositingQuality
*
);
GpStatus
WINGDIPAPI
GdipGetCompositingQuality
(
GpGraphics
*
,
CompositingQuality
*
);
GpStatus
WINGDIPAPI
GdipGetImageDimension
(
GpImage
*
,
REAL
*
,
REAL
*
);
GpStatus
WINGDIPAPI
GdipGetInterpolationMode
(
GpGraphics
*
,
InterpolationMode
*
);
GpStatus
WINGDIPAPI
GdipGetInterpolationMode
(
GpGraphics
*
,
InterpolationMode
*
);
GpStatus
WINGDIPAPI
GdipGetPageScale
(
GpGraphics
*
,
REAL
*
);
GpStatus
WINGDIPAPI
GdipGetPageScale
(
GpGraphics
*
,
REAL
*
);
GpStatus
WINGDIPAPI
GdipGetPageUnit
(
GpGraphics
*
,
GpUnit
*
);
GpStatus
WINGDIPAPI
GdipGetPageUnit
(
GpGraphics
*
,
GpUnit
*
);
...
...
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