From 51a223fdd0df32026e53a6eed3e866897896bf4b Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sun, 28 Mar 2010 20:05:04 -0500 Subject: [PATCH 1/2] gdiplus: Store a reference to the image in image graphics contexts. --- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/image.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index ca1cba6..fb2c1f5 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -112,6 +112,7 @@ struct GpGraphics{ HDC hdc; HWND hwnd; BOOL owndc; + GpImage *image; SmoothingMode smoothing; CompositingQuality compqual; InterpolationMode interpolation; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index bfed433..feef71c 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -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) -- 1.6.3.3