diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-05-21 13:39:20 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-05-21 13:39:20 +0000 |
commit | 0339e43208cd7b98d302e420b39ac32911acaa56 (patch) | |
tree | 48a68f806badb381b1d68dc65fd44fd594dda8e2 /vcl/source/gdi/outdev2.cxx | |
parent | bd35bcbd013dc4b4cff4cfeed5e18fb492c5ae9e (diff) |
INTEGRATION: CWS bmpres01 (1.17.36); FILE MERGED
2004/04/27 22:18:54 ka 1.17.36.3: RESYNC: (1.17-1.19); FILE MERGED
2004/04/15 11:48:59 ka 1.17.36.2: added support for MONOCHROME_BLACK AND ..._WHITE images/bitmaps
2004/02/11 16:15:08 ka 1.17.36.1: #i22149#: added alpha mask support for Images/ImageLists
Diffstat (limited to 'vcl/source/gdi/outdev2.cxx')
-rw-r--r-- | vcl/source/gdi/outdev2.cxx | 100 |
1 files changed, 98 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index 4837b6f21e74..6a880e244b17 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: outdev2.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: rt $ $Date: 2004-03-02 10:35:58 $ + * last change: $Author: rt $ $Date: 2004-05-21 14:39:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -113,6 +113,13 @@ #ifndef _SV_SALLAYOUT_HXX #include <sallayout.hxx> #endif +#ifndef _SV_IMAGE_H +#include <image.h> +#endif +#ifndef _SV_IMAGE_HXX +#include <image.hxx> +#endif + #define BAND_MAX_SIZE 512000 // ======================================================================= @@ -1110,6 +1117,95 @@ void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize, // ------------------------------------------------------------------ +void OutputDevice::DrawImage( const Point& rPos, const Image& rImage, USHORT nStyle ) +{ + DBG_CHKOBJ( &rImage, Image, NULL ); + DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" ); + + if( !rImage.mpImplData || ImplIsRecordLayout() ) + return; + + switch( rImage.mpImplData->meType ) + { + case IMAGETYPE_BITMAP: + DrawBitmap( rPos, *static_cast< Bitmap* >( rImage.mpImplData->mpData ) ); + break; + + case IMAGETYPE_IMAGE: + { + ImplImageData* pData = static_cast< ImplImageData* >( rImage.mpImplData->mpData ); + + if( !pData->mpImageBitmap ) + { + const Size aSize( pData->maBmpEx.GetSizePixel() ); + + pData->mpImageBitmap = new ImplImageBmp; + pData->mpImageBitmap->Create( pData->maBmpEx, aSize.Width(), aSize.Height(), 1 ); + } + + pData->mpImageBitmap->Draw( 0, this, rPos, nStyle ); + } + break; + + case IMAGETYPE_IMAGEREF: + { + ImplImageRefData* pData = static_cast< ImplImageRefData* >( rImage.mpImplData->mpData ); + pData->mpImplData->mpImageBitmap->Draw( pData->mnIndex, this, rPos, nStyle ); + } + break; + + default: + break; + } +} + +// ------------------------------------------------------------------ + +void OutputDevice::DrawImage( const Point& rPos, const Size& rSize, + const Image& rImage, USHORT nStyle ) +{ + DBG_CHKOBJ( &rImage, Image, NULL ); + DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER, "DrawImage(): Images can't be drawn on any mprinter" ); + + if( rImage.mpImplData && !ImplIsRecordLayout() ) + { + switch( rImage.mpImplData->meType ) + { + case IMAGETYPE_BITMAP: + DrawBitmap( rPos, rSize, *static_cast< Bitmap* >( rImage.mpImplData->mpData ) ); + break; + + case IMAGETYPE_IMAGE: + { + ImplImageData* pData = static_cast< ImplImageData* >( rImage.mpImplData->mpData ); + + if ( !pData->mpImageBitmap ) + { + const Size aSize( pData->maBmpEx.GetSizePixel() ); + + pData->mpImageBitmap = new ImplImageBmp; + pData->mpImageBitmap->Create( pData->maBmpEx, aSize.Width(), aSize.Height(), 1 ); + } + + pData->mpImageBitmap->Draw( 0, this, rPos, nStyle, &rSize ); + } + break; + + case IMAGETYPE_IMAGEREF: + { + ImplImageRefData* pData = static_cast< ImplImageRefData* >( rImage.mpImplData->mpData ); + pData->mpImplData->mpImageBitmap->Draw( pData->mnIndex, this, rPos, nStyle, &rSize ); + } + break; + + default: + break; + } + } +} + +// ------------------------------------------------------------------ + Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const { DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); |