From 6bd555fd034582352dca98266f600340ade1895e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= Date: Wed, 4 Dec 2013 16:57:34 +0100 Subject: [PATCH 036/109] EMF+: Do not ignore source rectangle of the image to be rendered. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4f861c7653c89d8f1ca73696e885f33f7bfc3b06 Reviewed-on: https://gerrit.libreoffice.org/6932 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cppcanvas/source/mtfrenderer/emfplus.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index bf9720b..2387934 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -1862,6 +1862,7 @@ namespace cppcanvas sal_Int32 aCount; ReadRectangle (rMF, sx, sy, sw, sh); + Rectangle aSource(Point(sx, sy), Size(sw, sh)); SAL_INFO("cppcanvas.emf", "EMF+ " << (type == EmfPlusRecordTypeDrawImagePoints ? "DrawImagePoints" : "DrawImage") << " source rectangle: " << sx << "," << sy << " " << sw << "x" << sh); @@ -1902,6 +1903,7 @@ namespace cppcanvas if (bValid) { BitmapEx aBmp( image.graphic.GetBitmapEx () ); + aBmp.Crop( aSource ); Size aSize( aBmp.GetSizePixel() ); SAL_INFO("cppcanvas.emf", "EMF+ bitmap size: " << aSize.Width() << "x" << aSize.Height()); -- 1.8.4.2