summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/outdev2.cxx
diff options
context:
space:
mode:
authorKai Ahrens <ka@openoffice.org>2001-07-04 14:25:01 +0000
committerKai Ahrens <ka@openoffice.org>2001-07-04 14:25:01 +0000
commited396986ecfc4b75a292164d5b3ca711aa00a9b8 (patch)
tree492ce0397772d038ad916ab5244a239c1e1bf3af /vcl/source/gdi/outdev2.cxx
parentc50f4c74d0ee922ee0b7d098a40b1ff11da3cedb (diff)
#89151#: don't convert alpha bitmaps to transparent bitmaps for printing
Diffstat (limited to 'vcl/source/gdi/outdev2.cxx')
-rw-r--r--vcl/source/gdi/outdev2.cxx50
1 files changed, 45 insertions, 5 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 1b736b9bef0e..cd3f0dbdb08e 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev2.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: ka $ $Date: 2000-10-26 08:46:33 $
+ * last change: $Author: ka $ $Date: 2001-07-04 15:25:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -825,9 +825,49 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
if( OUTDEV_PRINTER == meOutDevType )
{
- Bitmap aBmp( aBmpEx.GetBitmap() ), aMask( aBmpEx.GetMask() );
- aBmp.Replace( aMask, Color( COL_WHITE ) );
- ImplPrintTransparent( aBmp, aMask, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
+ Bitmap aBmp( aBmpEx.GetBitmap() );
+
+ if( aBmpEx.IsAlpha() )
+ {
+ if( !aBmp.IsEmpty() )
+ {
+ TwoRect aPosAry;
+
+ aPosAry.mnSrcX = rSrcPtPixel.X();
+ aPosAry.mnSrcY = rSrcPtPixel.Y();
+ aPosAry.mnSrcWidth = rSrcSizePixel.Width();
+ aPosAry.mnSrcHeight = rSrcSizePixel.Height();
+ aPosAry.mnDestX = ImplLogicXToDevicePixel( rDestPt.X() );
+ aPosAry.mnDestY = ImplLogicYToDevicePixel( rDestPt.Y() );
+ aPosAry.mnDestWidth = ImplLogicWidthToDevicePixel( rDestSize.Width() );
+ aPosAry.mnDestHeight = ImplLogicHeightToDevicePixel( rDestSize.Height() );
+
+ const ULONG nMirrFlags = ImplAdjustTwoRect( aPosAry, aBmp.GetSizePixel() );
+
+ if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
+ {
+ if ( nMirrFlags )
+ aBmp.Mirror( nMirrFlags );
+
+#ifndef REMOTE_APPSERVER
+ mpGraphics->DrawBitmap( &aPosAry, *aBmp.ImplGetImpBitmap()->ImplGetSalBitmap() );
+#else
+ aBmp.ImplDrawRemote( this,
+ Point( aPosAry.mnSrcX, aPosAry.mnSrcY ),
+ Size( aPosAry.mnSrcWidth, aPosAry.mnSrcHeight ),
+ Point( aPosAry.mnDestX, aPosAry.mnDestY ),
+ Size( aPosAry.mnDestWidth, aPosAry.mnDestHeight ) );
+#endif
+ }
+ }
+ }
+ else
+ {
+ Bitmap aMask( aBmpEx.GetMask() );
+ aBmp.Replace( aMask, Color( COL_WHITE ) );
+ ImplPrintTransparent( aBmp, aMask, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
+ }
+
return;
}
#ifndef REMOTE_APPSERVER