diff options
author | Patrick Jaap <patrick.jaap@tu-dresden.de> | 2017-08-08 09:48:15 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-08-09 10:16:31 +0200 |
commit | 5f040a4b0d1f50e3d619a8f147b36c79c375783e (patch) | |
tree | 48175e5aa32ae2d2ce59e50b324c759b5feaa740 /drawinglayer | |
parent | d500b2e98c15adef6d89900bbb1490065e10cd6e (diff) |
new EMF+ Parser: Implementation of drawImage
this small patch implements the EMF+ Record darwImage.
It generates a BitmapPrimitive2D.
Change-Id: I90d9a788ed9f520041c392d11f0d97f8e4233796
Reviewed-on: https://gerrit.libreoffice.org/40866
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/tools/emfphelperdata.cxx | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index 8528bcfbbfe1..335d5634880d 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -31,6 +31,7 @@ #include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx> #include <drawinglayer/primitive2d/svggradientprimitive2d.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> +#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> #include <drawinglayer/attribute/fontattribute.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> @@ -1031,20 +1032,15 @@ namespace emfplushelper SAL_INFO("cppcanvas.emf", "EMF+ bitmap size: " << aSize.Width() << "x" << aSize.Height()); if (aSize.Width() > 0 && aSize.Height() > 0) { - // ActionSharedPtr pBmpAction( - // internal::BitmapActionFactory::createBitmapAction( - // aBmp, - // rState.mapModeTransform * aDstPoint, - // rState.mapModeTransform * aDstSize, - // rCanvas, - // rState)); - // - // if (pBmpAction) { - // maActions.push_back(MtfAction(pBmpAction, - // rFactoryParms.mrCurrActionIndex)); - // - // rFactoryParms.mrCurrActionIndex += pBmpAction->getActionCount() - 1; - // } + // create correct transform matrix + basegfx::B2DHomMatrix aTransformMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix( + aDstSize.getX(), + aDstSize.getY(), + aDstPoint.getX(), + aDstPoint.getY()); + + mrTargetHolders.Current().append( + new drawinglayer::primitive2d::BitmapPrimitive2D(aBmp,aTransformMatrix)); } else { |