BaseFormDeviceScale Property

Gets the current scale of the form's display device. Before loading the form, or when per-monitor DPI awareness is not enabled, this property returns the system scale of the primary display, which is the same as the ScaleHelper.SystemScale property.

Definition

Namespace: KGySoft.WinForms.Forms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
[BrowsableAttribute(false)]
public PointF DeviceScale { get; }

Property Value

PointF

Remarks

This property is similar to the DeviceDpi property, but it returns the scale factor as a PointF value, and it is available for all .NET versions starting with .NET Framework 3.5.

  Note

Even on platforms where the DeviceDpi is available, the DeviceDpi property may return an incorrect value (e.g. the .NET Framework requires the DPI awareness settings in the app.config file, even if the awareness is set in the application manifest). In contrast, this property always returns the correct scale if there is an application manifest file or the DPI awareness is set for the application manually.

See Also