Table of Contents

Property ScaleFactor

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

ScaleFactor

Gets or sets the scale factor of this image.

public virtual double ScaleFactor { get; set; }

Property Value

double

Remarks

Scale factor is 1 by default, but can be greater to indicate that the size of bitmap in logical, DPI-independent pixels is smaller than its actual size in physical pixels. Bitmaps with scale factor greater than 1 must be used in high DPI to appear sharp on the screen. Note that the scale factor is only used in the ports where logical pixels are not the same as physical ones, such as MacOs or Linux, and this function always returns 1 under the other platforms. Setting scale to 2 means that the bitmap will be twice smaller (in each direction) when drawn on screen in the ports in which logical and physical pixels differ (i.e. MacOs and Linux, but not Windows). This doesn't change the bitmap actual size or its contents, but changes its scale factor, so that it appears in a smaller size when it is drawn on screen.