gdiplus: Added GdipGetImageGraphicsContext.

This commit is contained in:
Evan Stade 2007-08-09 18:25:01 -07:00 committed by Alexandre Julliard
parent ef7a7794ca
commit 94a19d1f75
3 changed files with 29 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -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*);