diff options
Diffstat (limited to 'vcl/source/image/ImplImage.cxx')
-rw-r--r-- | vcl/source/image/ImplImage.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/vcl/source/image/ImplImage.cxx b/vcl/source/image/ImplImage.cxx index 95d605e47173..7605f88d9767 100644 --- a/vcl/source/image/ImplImage.cxx +++ b/vcl/source/image/ImplImage.cxx @@ -39,14 +39,16 @@ ImplImage::ImplImage(const BitmapEx &rBitmapEx) : maBitmapChecksum(0) , maSizePixel(rBitmapEx.GetSizePixel()) + , maPreferedSizePixel() , maBitmapEx(rBitmapEx) { } -ImplImage::ImplImage(const OUString &aStockName) +ImplImage::ImplImage(const OUString &aStockName, Size const & rPreferedSize) : maBitmapChecksum(0) - , maSizePixel(0,0) // defer size lookup - , maStockName( aStockName ) + , maSizePixel() // defer size lookup + , maPreferedSizePixel(rPreferedSize) + , maStockName(aStockName) { } @@ -61,6 +63,11 @@ bool ImplImage::loadStockAtScale(double fScale, BitmapEx &rBitmapEx) SAL_WARN("vcl", "Failed to load scaled image from " << maStockName << " at " << fScale); return false; } + if (maPreferedSizePixel != Size()) + { + Size aScaleSize(maPreferedSizePixel.Width() * fScale, maPreferedSizePixel.Height() * fScale); + aBitmapEx.Scale(aScaleSize); + } rBitmapEx = aBitmapEx; return true; } |