/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
BitmapEx aBitmapEx;
{ // clear the canvas and basic sanity check ...
xBitmapCanvas->clear();
CPPUNIT_ASSERT(aBitmapEx.Create(xBitmapCanvas, aSize));
CPPUNIT_ASSERT(aBitmapEx.IsAlpha());
CPPUNIT_ASSERT(!aBitmapEx.GetAlphaMask().IsEmpty());
}
{ // render something
rendering::RenderState aDefaultState;
uno::Sequence<double> aRedTransparent{ 1.0, // R
0.0, // G
0.0, // B
0.5 }; // A
aDefaultState.DeviceColor = aRedTransparent; #if 0 // words fail me to describe the sheer beauty of allocating a UNO // object to represent a polygon, and manually handling the ViewState // and there being no public helper for this - to render ... a rectangle.
XCachedPrimitive fillPolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState ) #endif
}
}
// Then draw it using canvas
{
ScopedVclPtrInstance<VirtualDevice> pDev;
aOutputMetaFile.Record(pDev.get());
auto xCanvas = pDev->GetCanvas();
CPPUNIT_ASSERT(xCanvas.is()); auto pCanvas = cppcanvas::VCLFactory::createCanvas(xCanvas);
auto pRenderer = cppcanvas::VCLFactory::createRenderer(pCanvas, aInputMetaFile, {});
pRenderer->draw();
aOutputMetaFile.Stop();
}
// Then check that the text array drawn by the canvas renderer didn’t loose // the Kashida insertion positions.
{ auto pInputAction = aInputMetaFile.GetAction(aInputMetaFile.GetActionSize() - 1); auto pOutputAction = aOutputMetaFile.GetAction(aOutputMetaFile.GetActionSize() - 2);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.