Search code examples
windowswinformsfont-sizemagnification

Need to find you if the user is using magnified font size 125% or 150% in win 7


Does anyone know if I can check this parameter anywhere?


Solution

  • You can read Graphics.DpiX to discern this.

    Multiply Graphics.DpiX by 100 and divide by 96 and you will have the percentage font scaling. This is true because 100% font scaling equates to 96dpi.

    Be warned that if your application is not marked as DPI aware then when the user sets font scaling to 150% the DpiX property will report 96. Off the top of my head I do not know whether or not standard WinForms apps are marked as DPI aware.