mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
gdiplus: Implemented GdipGetImageBounds for metafiles.
This commit is contained in:
parent
6d9e4a4a92
commit
586e63ef38
@ -124,6 +124,8 @@ struct GpImage{
|
||||
|
||||
struct GpMetafile{
|
||||
GpImage image;
|
||||
GpRectF bounds;
|
||||
GpUnit unit;
|
||||
};
|
||||
|
||||
struct GpImageAttributes{
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user