diff options
author | B. Stack <bgstack15@gmail.com> | 2022-04-18 09:47:11 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-04-18 09:47:40 -0400 |
commit | b4b2e4a096fe8fe1ad530a4c181729be05834595 (patch) | |
tree | 84e67ca0a1fb045a12d015fcffca9cd8087c9332 /wx+/dc.h | |
parent | Merge branch 'b11.18' into 'master' (diff) | |
download | FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.tar.gz FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.tar.bz2 FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.zip |
add upstream 11.20
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 { |