class PreviewRenderer final
: public SfxListener
{ public: /** Create a new preview renderer that takes some of its initial values fromthegivenoutputdevice. @parambPaintFrame When<TRUE/>(thedefault)thenaframeispaintedaroundthe preview.Thismakestheactualpreviewsmaller.
*/
PreviewRenderer(constbool bPaintFrame = true);
virtual ~PreviewRenderer() override;
/** Render a page with the given pixel size. Usethisversionwhenonlythewidthofthepreviewisknowntothe caller.Theheightisthencalculatedaccordingtotheaspect ratioofthegivenpage. @parampPage Thepagetorender. @paramnWidth Thewidthofthepreviewindevicecoordinates. Thehighcontrastmodeoftheapplicationis ignoredandthepreviewisrenderedinnormalmode.
*/
Image RenderPage ( const SdPage* pPage, const sal_Int32 nWidth);
/** Render a page with the given pixel size. @parampPage Thepagetorender. @paramaPreviewPixelSize Thesizeindevicecoordinatesofthepreview. @parambObeyHighContrastMode When<FALSE/>thenthehighcontrastmodeoftheapplicationis ignoredandthepreviewisrenderedinnormalmode.When <TRUE/>andhighcontrastmodeisactivethenthepreviewis renderedinhighcontrastmode. @parambDisplayPresentationObjects When<FALSE/>thenthePresObjplaceholdersarenotdisplayed inthereturnedpreview.
*/
Image RenderPage ( const SdPage* pPage, const Size aPreviewPixelSize, constbool bObeyHighContrastMode, constbool bDisplayPresentationObjects = true);
/** Render an image that contains the given substitution text instead of a slidepreview. @paramaPreviewPixelSize Thesizeindevicecoordinatesoftheimage.
*/
Image RenderSubstitution ( const Size& rPreviewPixelSize, const OUString& sSubstitutionText);
/** Scale the given bitmap by keeping its aspect ratio to the desired width.Addaframetoitafterwards.
*/
Image ScaleBitmap ( const BitmapEx& rBitmap, int nWidth);
private:
ScopedVclPtr<VirtualDevice> mpPreviewDevice;
::std::unique_ptr<DrawView> mpView;
DrawDocShell* mpDocShellOfView; const Color maFrameColor; constbool mbHasFrame; staticconstint snSubstitutionTextSize; // Width of the frame that is painted around the preview. staticconstint snFrameWidth;
/** Set up the map mode so that the given page is renderer into a bitmap withthespecifiedwidth. @paramrPage Thepageforwhichthepreviewiscreated. @paramrPixelSize Thesizeoftheresultingpreviewbitmap.Notethatthissize includestheframe.Theactualpreviewissmalleraccordingly.
*/ void SetupOutputSize (const SdPage& rPage, const Size& rPixelSize);
/** When mpView is empty then create a new view and initialize it. Otherwisejustinitializeit.
*/ void ProvideView (DrawDocShell* pDocShell);
};
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 und die Messung sind noch experimentell.