gdiplus: Store a reference to the image in image graphics contexts.

This commit is contained in:
Vincent Povirk 2010-03-28 20:05:04 -05:00 committed by Alexandre Julliard
parent ffc9397664
commit af7b8efc94
2 changed files with 8 additions and 1 deletions

View File

@ -112,6 +112,7 @@ struct GpGraphics{
HDC hdc;
HWND hwnd;
BOOL owndc;
GpImage *image;
SmoothingMode smoothing;
CompositingQuality compqual;
InterpolationMode interpolation;

View File

@ -1946,6 +1946,7 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image,
GpGraphics **graphics)
{
HDC hdc;
GpStatus stat;
TRACE("%p %p\n", image, graphics);
@ -1965,7 +1966,12 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image,
((GpBitmap*)image)->hdc = hdc;
}
return GdipCreateFromHDC(hdc, graphics);
stat = GdipCreateFromHDC(hdc, graphics);
if (stat == Ok)
(*graphics)->image = image;
return stat;
}
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)