hanselb / HyperionScreenCap

Screen capture program for Hyperion ambilight
MIT License
60 stars 26 forks source link

If Windows 10 DPI scaling is > 100% it will not capture and report an DX error (no surface to capture) #10

Open hanselb opened 8 years ago

hanselb commented 8 years ago

If Windows 10 DPI scaling is > 100% it will not capture and report an DX error (no surface to capture)

SodaleJetzedle commented 7 years ago

I think the problem is in Screen.PrimaryScreen.Bounds.Width / Screen.PrimaryScreen.Bounds.Height because they return a scaled resolution.

The following change in the main method worked for me to set the DPI awareness and get unscaled values

        [System.Runtime.InteropServices.DllImport("user32.dll")]
        private static extern bool SetProcessDPIAware();

        [STAThread]
        private static void Main()
        {
            SetProcessDPIAware();