gdiplus: Implemented GdipGetImageBounds for metafiles.

This commit is contained in:
Evan Stade 2007-07-30 19:09:57 -07:00 committed by Alexandre Julliard
parent 6d9e4a4a92
commit 586e63ef38
3 changed files with 19 additions and 6 deletions

View File

@ -124,6 +124,8 @@ struct GpImage{
struct GpMetafile{
GpImage image;
GpRectF bounds;
GpUnit unit;
};
struct GpImageAttributes{

View File

@ -895,6 +895,14 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
}
(*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);

View File

@ -45,15 +45,18 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
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)