diff --git a/src/client/spark/view/Utility/ScreenCapture.cs b/src/client/spark/view/Utility/ScreenCapture.cs index b736b8cb2..c0d64a000 100644 --- a/src/client/spark/view/Utility/ScreenCapture.cs +++ b/src/client/spark/view/Utility/ScreenCapture.cs @@ -4,6 +4,7 @@ using System.IO; using System.Windows; using System.Windows.Interop; using System.Windows.Media.Imaging; +using mbts.config; using mbts.ui.native; namespace mbts.ui.utility @@ -46,10 +47,15 @@ namespace mbts.ui.utility return null; } + static (int width,int height) screen_size() { + var config = Configuration.get(); + double width = SystemParameters.VirtualScreenWidth * config.dpi_ratio; + double height = SystemParameters.VirtualScreenHeight * config.dpi_ratio; + return ((int)width, (int)height); + } private static BitmapSource capture() { - int width = (int)SystemParameters.VirtualScreenWidth; - int height = (int)SystemParameters.VirtualScreenHeight; + (int width, int height) = screen_size(); IntPtr screen_dc = NativeMethods.GetDC(IntPtr.Zero); IntPtr mem_dc = NativeMethods.CreateCompatibleDC(screen_dc); IntPtr hbitmap = NativeMethods.CreateCompatibleBitmap(screen_dc, width, height); @@ -64,8 +70,7 @@ namespace mbts.ui.utility private static BitmapSource capture(int width_dest, int height_dest) { - int width_src = (int)SystemParameters.VirtualScreenWidth; - int height_src = (int)SystemParameters.VirtualScreenHeight; + (int width_src, int height_src) = screen_size(); IntPtr screen_dc = NativeMethods.GetDC(IntPtr.Zero); IntPtr mem_dc = NativeMethods.CreateCompatibleDC(screen_dc); IntPtr hbitmap = NativeMethods.CreateCompatibleBitmap(screen_dc, width_dest, height_dest);