From 507d0ded64db51a8826d07c507f612a6c02c3869 Mon Sep 17 00:00:00 2001 From: Caolán McNamara <caolanm@redhat.com> Date: Tue, 1 Dec 2015 12:18:57 +0000 Subject: keep disable image at same depth as original that way the "preferred" image format for a platform for icons etc remains sticky Change-Id: Ia76af0b7c4f27650038cab214b6406b8ef1a5fc4 --- vcl/source/bitmap/BitmapProcessor.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl') diff --git a/vcl/source/bitmap/BitmapProcessor.cxx b/vcl/source/bitmap/BitmapProcessor.cxx index 44a0f7d54bea..bdc7b489bf33 100644 --- a/vcl/source/bitmap/BitmapProcessor.cxx +++ b/vcl/source/bitmap/BitmapProcessor.cxx @@ -59,7 +59,7 @@ BitmapEx BitmapProcessor::createDisabledImage(const BitmapEx& rBitmapEx) { const Size aSize(rBitmapEx.GetSizePixel()); - Bitmap aGrey(aSize, 8, &Bitmap::GetGreyPalette(256)); + Bitmap aGrey(aSize, rBitmapEx.GetBitCount()); AlphaMask aGreyAlpha(aSize); Bitmap aBitmap(rBitmapEx.GetBitmap()); @@ -77,14 +77,14 @@ BitmapEx BitmapProcessor::createDisabledImage(const BitmapEx& rBitmapEx) if (pRead && pReadAlpha && pGrey && pGreyAlpha) { - BitmapColor aGreyValue(0); BitmapColor aGreyAlphaValue(0); for (long nY = 0; nY < aSize.Height(); ++nY) { for (long nX = 0; nX < aSize.Width(); ++nX) { - aGreyValue.SetIndex(pRead->GetLuminance(nY, nX)); + const sal_uInt8 nLum(pRead->GetLuminance(nY, nX)); + BitmapColor aGreyValue(nLum, nLum, nLum); pGrey->SetPixel(nY, nX, aGreyValue); const BitmapColor aBitmapAlphaValue(pReadAlpha->GetPixel(nY, nX)); @@ -101,14 +101,14 @@ BitmapEx BitmapProcessor::createDisabledImage(const BitmapEx& rBitmapEx) { if (pRead && pGrey && pGreyAlpha) { - BitmapColor aGreyValue(0); BitmapColor aGreyAlphaValue(0); for (long nY = 0; nY < aSize.Height(); ++nY) { for (long nX = 0; nX < aSize.Width(); ++nX) { - aGreyValue.SetIndex(pRead->GetLuminance(nY, nX)); + const sal_uInt8 nLum(pRead->GetLuminance(nY, nX)); + BitmapColor aGreyValue(nLum, nLum, nLum); pGrey->SetPixel(nY, nX, aGreyValue); aGreyAlphaValue.SetIndex(128); -- cgit