From c7e172f90682dfbc1b76d64d5455ed9dbf0c4c04 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 14 Apr 2013 18:06:28 +0300 Subject: [PATCH] Gfx: Fix D2D DrawBitmap when source X/Y is not 0 --- Common/Gfx/CanvasD2D.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Common/Gfx/CanvasD2D.cpp b/Common/Gfx/CanvasD2D.cpp index 0bac208a..79089cfd 100644 --- a/Common/Gfx/CanvasD2D.cpp +++ b/Common/Gfx/CanvasD2D.cpp @@ -412,8 +412,9 @@ void CanvasD2D::DrawBitmap(Gdiplus::Bitmap* bitmap, const Gdiplus::Rect& dstRect // not using a hardware accelerated render target. Nevertheless, we will use it to avoid // the EndDraw() call needed for GDI+ drawing. Util::WICBitmapLockGDIP* bitmapLock = new Util::WICBitmapLockGDIP(); + Gdiplus::Rect lockRect(0, 0, bitmap->GetWidth(), bitmap->GetHeight()); Gdiplus::Status status = bitmap->LockBits( - &srcRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData()); + &lockRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData()); if (status == Gdiplus::Ok) { D2D1_BITMAP_PROPERTIES props = D2D1::BitmapProperties(