Kaydet (Commit) 592cacd5 authored tarafından Kai Ahrens's avatar Kai Ahrens

#98762#: added methods to create high contrast bitmaps

üst 91f158b4
......@@ -2,9 +2,9 @@
*
* $RCSfile: bitmap.cxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-18 17:05:37 $
* last change: $Author: ka $ $Date: 2002-04-22 08:51:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -94,6 +94,9 @@
#ifndef _SV_SVAPP_HXX
#include <svapp.hxx>
#endif
#ifndef _SV_IMAGE_HXX
#include <image.hxx>
#endif
// ------------------------------------------------------------------
......@@ -1767,6 +1770,26 @@ Bitmap Bitmap::CreateDisplayBitmap( OutputDevice* pDisplay )
// ------------------------------------------------------------------
Bitmap Bitmap::GetColorTransformedBitmap( BmpColorMode eColorMode ) const
{
Bitmap aRet( *this );
Color* pSrcColors = NULL;
Color* pDstColors = NULL;
ULONG nColorCount = 0;
Image::GetColorTransformArrays( static_cast< ImageColorTransform >( eColorMode ), pSrcColors, pDstColors, nColorCount );
if( nColorCount && pSrcColors && pDstColors )
aRet.Replace( pSrcColors, pDstColors, nColorCount );
delete[] pSrcColors;
delete[] pDstColors;
return aRet;
}
// ------------------------------------------------------------------
BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
{
BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: bitmapex.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: jl $ $Date: 2001-03-20 10:03:56 $
* last change: $Author: ka $ $Date: 2002-04-22 08:51:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -268,6 +268,17 @@ Bitmap BitmapEx::GetBitmap( const Color* pTransReplaceColor ) const
// ------------------------------------------------------------------
BitmapEx BitmapEx::GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const
{
BitmapEx aRet( *this );
aRet.aBitmap = aBitmap.GetColorTransformedBitmap( eColorMode );
return aRet;
}
// ------------------------------------------------------------------
Bitmap BitmapEx::GetMask() const
{
Bitmap aRet( aMask );
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: impimage.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: ka $ $Date: 2002-03-05 13:20:07 $
* last change: $Author: ka $ $Date: 2002-04-22 08:51:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -512,19 +512,7 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
aTmpMsk.Crop( aCropRect );
if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
{
Color* pSrcColors = NULL;
Color* pDstColors = NULL;
ULONG nColorCount = 0;
Image::GetColorTransformArrays( IMAGECOLORTRANSFORM_HIGHCONTRAST, pSrcColors, pDstColors, nColorCount );
if( nColorCount && pSrcColors && pDstColors )
aTmpBmp.Replace( pSrcColors, pDstColors, nColorCount );
delete[] pSrcColors;
delete[] pDstColors;
}
aTmpBmp = aTmpBmp.GetColorTransformedBitmap( BMP_COLOR_HIGHCONTRAST );
if( nStyle & ( IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE ) )
{
......@@ -619,10 +607,20 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
bFastTransparent = bTmp;
#endif
}
else if( pSize )
pOutDev->DrawBitmap( rPos, *pSize, aPos, aSize, aBmpEx.GetBitmap() );
else
pOutDev->DrawBitmap( rPos, pOutDev->PixelToLogic( aSize ), aPos, aSize, aBmpEx.GetBitmap() );
{
BitmapEx aTmpBmpEx;
if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
aTmpBmpEx = aBmpEx.GetColorTransformedBitmapEx( BMP_COLOR_HIGHCONTRAST );
else
aTmpBmpEx = aBmpEx;
if( pSize )
pOutDev->DrawBitmap( rPos, *pSize, aPos, aSize, aTmpBmpEx.GetBitmap() );
else
pOutDev->DrawBitmap( rPos, pOutDev->PixelToLogic( aSize ), aPos, aSize, aTmpBmpEx.GetBitmap() );
}
}
}
......
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