[7/8] gdiplus: implemented GdipGetImageBounds for metafiles
Evan Stade
estade at gmail.com
Mon Jul 30 21:09:57 CDT 2007
Hi,
dlls/gdiplus/gdiplus_private.h | 2 ++
dlls/gdiplus/graphics.c | 8 ++++++++
dlls/gdiplus/image.c | 15 +++++++++------
3 files changed, 19 insertions(+), 6 deletions(-)
--
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index e440dba..c31de0e 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -124,6 +124,8 @@ struct GpImage{
struct GpMetafile{
GpImage image;
+ GpRectF bounds;
+ GpUnit unit;
};
struct GpImageAttributes{
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index ee42c02..8ab3af1 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -892,6 +892,14 @@ GpStatus WINGDIPAPI GdipCreateMetafileFr
}
(*metafile)->image.type = ImageTypeMetafile;
+ (*metafile)->bounds.X = ((REAL) placeable->BoundingBox.Left) / ((REAL) placeable->Inch);
+ (*metafile)->bounds.Y = ((REAL) placeable->BoundingBox.Right) / ((REAL) placeable->Inch);
+ (*metafile)->bounds.Width = ((REAL) (placeable->BoundingBox.Right
+ - placeable->BoundingBox.Left)) / ((REAL) placeable->Inch);
+ (*metafile)->bounds.Height = ((REAL) (placeable->BoundingBox.Bottom
+ - placeable->BoundingBox.Top)) / ((REAL) placeable->Inch);
+ (*metafile)->unit = UnitInch;
+
if(delete)
DeleteMetaFile(hwmf);
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index 849b1b4..9b6ed41 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -45,15 +45,18 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpI
GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
GpUnit *srcUnit)
{
- static int calls;
-
if(!image || !srcRect || !srcUnit)
return InvalidParameter;
+ if(image->type == ImageTypeMetafile){
+ memcpy(srcRect, &((GpMetafile*)image)->bounds, sizeof(GpRectF));
+ *srcUnit = ((GpMetafile*)image)->unit;
+ }
+ else{
+ FIXME("not implemented for bitmaps\n");
+ return NotImplemented;
+ }
- if(!(calls++))
- FIXME("not implemented\n");
-
- return NotImplemented;
+ return Ok;
}
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
--
1.4.1
More information about the wine-patches
mailing list