summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-03-03 20:21:48 +0100
committerTomaž Vajngerl <quikee@gmail.com>2013-03-03 20:57:02 +0100
commitdca9978fdbd96f0b23b3e52431bf074d259ceec1 (patch)
treed26a4054c06a2f180e915a6c13a78b867b5fce63 /vcl
parent5f2592b47fe534a873a7342b932ecc9a7094310a (diff)
121687# better preview
Change-Id: I7beca0f3d809e5a2ab3d8ef6c73b970010a47eaf
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/printdlg.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index e226f78c64e6..7562a16880a5 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -177,7 +177,7 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
{
GDIMetaFile aMtf( maMtf );
- Size aVDevSize( maPageVDev.GetOutputSizePixel() );
+ const Size aVDevSize( maPageVDev.GetOutputSizePixel() );
const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) );
Size aOrigSize( maOrigSize );
if( aOrigSize.Width() < 1 )
@@ -198,12 +198,23 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
aMtf.WindStart();
aMtf.Scale( fScale, fScale );
aMtf.WindStart();
+
+ const sal_uInt16 nOriginalAA(maPageVDev.GetAntialiasing());
+ maPageVDev.SetAntialiasing(nOriginalAA | ANTIALIASING_ENABLE_B2DDRAW);
+
aMtf.Play( &maPageVDev, Point( 0, 0 ), aLogicSize );
maPageVDev.Pop();
+ maPageVDev.SetAntialiasing(nOriginalAA);
+
SetMapMode( MAP_PIXEL );
maPageVDev.SetMapMode( MAP_PIXEL );
- DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev );
+
+ // use lanzcos scaling
+ Bitmap aContent(maPageVDev.GetBitmap(Point(0, 0), aVDevSize));
+ aContent.Scale(maPreviewSize, BMP_SCALE_BEST);
+ DrawBitmap(aOffset, aContent);
+
maPageVDev.SetDrawMode( nOldDrawMode );
}