Gfx: Fix D2D DrawBitmap when source X/Y is not 0

This commit is contained in:
Birunthan Mohanathas 2013-04-14 18:06:28 +03:00
parent 31d717085e
commit c7e172f906

View File

@ -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 // not using a hardware accelerated render target. Nevertheless, we will use it to avoid
// the EndDraw() call needed for GDI+ drawing. // the EndDraw() call needed for GDI+ drawing.
Util::WICBitmapLockGDIP* bitmapLock = new Util::WICBitmapLockGDIP(); Util::WICBitmapLockGDIP* bitmapLock = new Util::WICBitmapLockGDIP();
Gdiplus::Rect lockRect(0, 0, bitmap->GetWidth(), bitmap->GetHeight());
Gdiplus::Status status = bitmap->LockBits( Gdiplus::Status status = bitmap->LockBits(
&srcRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData()); &lockRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData());
if (status == Gdiplus::Ok) if (status == Gdiplus::Ok)
{ {
D2D1_BITMAP_PROPERTIES props = D2D1::BitmapProperties( D2D1_BITMAP_PROPERTIES props = D2D1::BitmapProperties(