diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-01 12:18:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-02 13:44:24 +0000 |
commit | 507d0ded64db51a8826d07c507f612a6c02c3869 (patch) | |
tree | b674f0745928a0bbd86f3fbc74deb6bdd8647452 /vcl/source | |
parent | 5049d5825e2d85fae32ee2eb9e0fe428aa2a7e16 (diff) |
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
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/bitmap/BitmapProcessor.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
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); |