diff options
author | B. Stack <bgstack15@gmail.com> | 2022-04-18 13:48:31 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-04-18 13:48:31 +0000 |
commit | 8a551d2eff24bdd23bc25caeb8d17207409aae38 (patch) | |
tree | 84e67ca0a1fb045a12d015fcffca9cd8087c9332 /wx+/dc.h | |
parent | Merge branch 'b11.18' into 'master' (diff) | |
parent | add upstream 11.20 (diff) | |
download | FreeFileSync-11.20.tar.gz FreeFileSync-11.20.tar.bz2 FreeFileSync-11.20.zip |
Merge branch 'b11.20' into 'master'11.20
add upstream 11.20
See merge request opensource-tracking/FreeFileSync!43
Diffstat (limited to 'wx+/dc.h')
-rw-r--r-- | wx+/dc.h | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -12,6 +12,7 @@ #include <zen/basic_math.h> #include <wx/dcbuffer.h> //for macro: wxALWAYS_NATIVE_DOUBLE_BUFFER #include <wx/dcscreen.h> +#include <wx/bmpbndl.h> #include <gtk/gtk.h> @@ -91,8 +92,8 @@ constexpr int defaultDpi = 96; inline int getDPI() { -#ifndef wxHAVE_DPI_INDEPENDENT_PIXELS -#error why is wxHAVE_DPI_INDEPENDENT_PIXELS not defined? +#ifndef wxHAS_DPI_INDEPENDENT_PIXELS +#error why is wxHAS_DPI_INDEPENDENT_PIXELS not defined? #endif //GTK2 doesn't properly support high DPI: https://freefilesync.org/forum/viewtopic.php?t=6114 //=> requires general fix at wxWidgets-level @@ -117,6 +118,16 @@ int getDpiScalePercent() } +inline +wxBitmapBundle toBitmapBundle(const wxImage& img /*expected to be DPI-scaled!*/) +{ + //return wxBitmap(img, -1 /*depth*/, static_cast<double>(getDPI()) / defaultDpi); not (yet) implemented + wxBitmap bmpScaled(img); + bmpScaled.SetScaleFactor(static_cast<double>(getDPI()) / defaultDpi); + return bmpScaled; +} + + //---------------------- implementation ------------------------ class RecursiveDcClipper { |