diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-04-12 11:11:13 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-04-12 13:56:53 +0200 |
commit | 812f0a83d223cddf00b121db40ca7ff91c22ccfa (patch) | |
tree | 8137fdfbac1f3c50bcd5b55ef66cd036aef0e455 /include | |
parent | ed437865a0db175e45ff421d50f429dff421d0cf (diff) |
internally resize image instead of scaling bitmaps outside
When we want a different size Image, we can now set that as a
parameter at construction of the Image. Previously we needed to
create an Image, forcefully take the bitmap out, resize the bitmap
and create a new Image out of that.
Doing it internally gives us the benefit to have a more control
over the scaling process, especially when dealing with HiDPI
images.
Change-Id: I104118f4d863d519cc7aad1a17ca0289c01ed9ff
Reviewed-on: https://gerrit.libreoffice.org/70617
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/imagemgr.hxx | 5 | ||||
-rw-r--r-- | include/vcl/image.hxx | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/svtools/imagemgr.hxx b/include/svtools/imagemgr.hxx index 45212829b5c6..697ab8aeb41c 100644 --- a/include/svtools/imagemgr.hxx +++ b/include/svtools/imagemgr.hxx @@ -22,6 +22,7 @@ #include <rtl/ustring.hxx> #include <svtools/svtdllapi.h> +#include <tools/gen.hxx> enum class SvImageId { NONE = 0, @@ -119,10 +120,10 @@ private: public: SVT_DLLPUBLIC static OUString GetImageId( const INetURLObject& rURL, bool bBig = false ); - SVT_DLLPUBLIC static Image GetImage( const INetURLObject& rURL, bool bBig = false ); + SVT_DLLPUBLIC static Image GetImage( const INetURLObject& rURL, bool bBig = false, Size const & rPreferredSize = Size()); SVT_DLLPUBLIC static OUString GetFileImageId( const INetURLObject& rURL ); SVT_DLLPUBLIC static Image GetFileImage( const INetURLObject& rURL ); - SVT_DLLPUBLIC static Image GetImageNoDefault( const INetURLObject& rURL, bool bBig = false ); + SVT_DLLPUBLIC static Image GetImageNoDefault(const INetURLObject& rURL, bool bBig = false, Size const & rPreferredSize = Size()); SVT_DLLPUBLIC static Image GetFolderImage( const svtools::VolumeInfo& rInfo ); SVT_DLLPUBLIC static OUString GetDescription( const INetURLObject& rObject ); diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx index b2f64c138bac..4c5047518bf3 100644 --- a/include/vcl/image.hxx +++ b/include/vcl/image.hxx @@ -27,7 +27,7 @@ #include <memory> -struct ImplImage; +class ImplImage; namespace com::sun::star::graphic { class XGraphic; } namespace com::sun::star::uno { template <class interface_type> class Reference; } @@ -57,7 +57,7 @@ public: explicit Image(BitmapEx const & rBitmapEx); explicit Image(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic); explicit Image(OUString const & rPNGFileUrl); - explicit Image(StockImage , OUString const & rPNGFilePath); + explicit Image(StockImage, OUString const & rPNGFilePath, Size aSpecificSize = Size()); Size GetSizePixel() const; BitmapEx GetBitmapEx() const; |