C# Get Windows Screen Scaling

Date: 2024-05-13
public static double GetWindowsScaling()
{
    var mainForm = System.Windows.Forms.Application.OpenForms[0];
    return (mainForm?.DeviceDpi ?? 96) / 96.0;
}
85260cookie-checkC# Get Windows Screen Scaling