Commit 94a19d1f authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Added GdipGetImageGraphicsContext.

parent ef7a7794
......@@ -287,7 +287,7 @@
@ stub GdipGetImageEncoders
@ stub GdipGetImageEncodersSize
@ stub GdipGetImageFlags
@ stub GdipGetImageGraphicsContext
@ stdcall GdipGetImageGraphicsContext(ptr ptr)
@ stdcall GdipGetImageHeight(ptr ptr)
@ stdcall GdipGetImageHorizontalResolution(ptr ptr)
@ stub GdipGetImageItemData
......
......@@ -384,9 +384,13 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream,
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
{
HDC hdc;
if(!image)
return InvalidParameter;
IPicture_get_CurDC(image->picture, &hdc);
DeleteDC(hdc);
IPicture_Release(image->picture);
GdipFree(image);
......@@ -429,6 +433,29 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
return Ok;
}
GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image,
GpGraphics **graphics)
{
HDC hdc;
if(!image || !graphics)
return InvalidParameter;
if(image->type != ImageTypeBitmap){
FIXME("not implemented for image type %d\n", image->type);
return NotImplemented;
}
IPicture_get_CurDC(image->picture, &hdc);
if(!hdc){
hdc = CreateCompatibleDC(0);
IPicture_SelectPicture(image->picture, hdc, NULL, NULL);
}
return GdipCreateFromHDC(hdc, graphics);
}
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
{
if(!image || !height)
......
......@@ -192,6 +192,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream*,GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream*,GpBitmap**);
GpStatus WINGDIPAPI GdipDisposeImage(GpImage*);
GpStatus WINGDIPAPI GdipGetImageBounds(GpImage*,GpRectF*,GpUnit*);
GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage*,GpGraphics**);
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage*,UINT*);
GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage*,REAL*);
GpStatus WINGDIPAPI GdipGetImagePixelFormat(GpImage*,PixelFormat*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment