diff options
author | Armin Le Grand <alg@apache.org> | 2013-01-30 11:04:41 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2013-01-30 11:04:41 +0000 |
commit | 0529555deec496e51a33ad11d2709c3cec063114 (patch) | |
tree | a493ef87337372317da91804dda465eaf3eb4c87 /vcl | |
parent | c6e63b6bbb6b4a63fe1302de57fc32cd28432378 (diff) |
121687# better preview
Notes
Notes:
prefer: 9058681a8d4f52db18f094994b231e719e9bb6eb
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/printdlg.cxx | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 64eb3d965a1f..c874b5e1a795 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -250,7 +250,7 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2 + nTextHeight, (aSize.Height() - maPreviewSize.Height()) / 2 + nTextHeight ); - 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 ) @@ -271,12 +271,38 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) aMtf.WindStart(); aMtf.Scale( fScale, fScale ); aMtf.WindStart(); + + const sal_uInt16 nOriginalAA(maPageVDev.GetAntialiasing()); + static bool bNicePrintPreview(true); + + if(bNicePrintPreview) + { + // replay metafile with AntiAliasing + maPageVDev.SetAntialiasing(nOriginalAA | ANTIALIASING_ENABLE_B2DDRAW); + } + aMtf.Play( &maPageVDev, Point( 0, 0 ), aLogicSize ); + + maPageVDev.SetAntialiasing(nOriginalAA); maPageVDev.Pop(); SetMapMode( MAP_PIXEL ); maPageVDev.SetMapMode( MAP_PIXEL ); - DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev ); + + if(bNicePrintPreview) + { + // use lanzcos scaling + Bitmap aContent(maPageVDev.GetBitmap(Point(0, 0), aVDevSize)); + aContent.Scale(maPreviewSize, BMP_SCALE_BESTQUALITY); + DrawBitmap(aOffset, aContent); + } + else + { + // direct paint (copy from OutDev to OutDev) is fast, but does not do + // any good scaling at all (currently) + DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev ); + } + maPageVDev.SetDrawMode( nOldDrawMode ); DecorationView aVw( this ); |