Kaydet (Commit) d51bc7b3 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Armin Le Grand

PrintPreviewWindow dynamic preview Bitmap

The PrintDialog includes a preview (PrintPreviewWindow)
that currently used a fixed-pixel-size preview that takes
the aspect ratio into account (which may already explode
due to just growing vertically - try a much higher than
wide page). It is not dynamic and by using the high-quality
scale (BmpScaleFlag::BestQuality) for output it can get
rather slow in repainting. Also holds the VDev for creating
the preview all the time without need.
Made that process dynamic and responding to real resizing,
thus not using that huge number of pixels from the start.
Also use a VDev only temporary and use intelligent size
management.
Still keeping the high-quality scale due to ::DrawBitmap
with a target size not scaling well (still) and also
::DrawOutDev not good in quality. Those two should work
better nowadays, but adaption would be risky.

Change-Id: I211412a063def33a4e8f40c7442702770cd11a8e
Reviewed-on: https://gerrit.libreoffice.org/52150Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarArmin Le Grand <Armin.Le.Grand@cib.de>
üst 7571d0f8
......@@ -39,12 +39,11 @@ namespace vcl
public:
class PrintPreviewWindow : public vcl::Window
{
static const sal_Int32 PREVIEW_BITMAP_WIDTH;
GDIMetaFile maMtf;
Size maOrigSize;
Size maPreviewSize;
VclPtr<VirtualDevice> maPageVDev;
sal_Int32 mnDPIX;
sal_Int32 mnDPIY;
Bitmap maPreviewBitmap;
OUString maReplacementString;
OUString maToolTipString;
......@@ -62,7 +61,6 @@ namespace vcl
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
virtual void Command( const CommandEvent& ) override;
virtual void Resize() override;
virtual void DataChanged( const DataChangedEvent& ) override;
void setPreview( const GDIMetaFile&, const Size& i_rPaperSize,
const OUString& i_rPaperName,
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment