[Libreoffice-commits] core.git: drawinglayer/source
Patrick Jaap
patrick.jaap at tu-dresden.de
Wed Aug 9 08:17:12 UTC 2017
drawinglayer/source/tools/emfphelperdata.cxx | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
New commits:
commit 5f040a4b0d1f50e3d619a8f147b36c79c375783e
Author: Patrick Jaap <patrick.jaap at tu-dresden.de>
Date: Tue Aug 8 09:48:15 2017 +0200
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 at libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>
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
{
More information about the Libreoffice-commits
mailing list