ChartDirector 7.1 (.NET Edition)

WPFViewPortControl.setDPI


Usage

[C#]public void setDPI(int dpi);
[VB]Public Sub setDPI(dpi As Integer)

Description

Sets the DPI (scale factor) of the chart on the screen.

Due to historical reasons, in programming, the display is assumed to be 96dpi (dot per inch). Modern operating systems also allows using higher DPI. For example, on Windows 10, in "Settings / System / Display", it is possible set a display scale factor such as 150%, which corresponds to 144dpi.

If the application is configured as "not DPI aware", the OS will assume the application GUI is 96dpi. The operating system will then resize the application output before displaying it on the screen.

If the application is configured as "DPI aware", the OS will assume the application will resize its GUI to match the display DPI, and the OS will not resize the application output again.

WPFViewPortControl will automatically detect if the application is "DPI aware" or not, and will automatically resize the chart to match the display DPI.

The setDPI method can be used to configure an alternative scale factor. For example, if the user code has already resized the chart, it is not necessary for the WPFViewPortControl to resize the chart again. In this case, setDPI can be used to set the DPI to 96 to disable the WPFViewPortControl from resizing the chart.

Arguments

ArgumentDefaultDescription
dpi(Mandatory)The DPI to display the chart on the screen. A value of 0 means the DPI will be automatically determined.

Return Value

None