Converts a size or a position specified in the reference dpi in the editor (160 dpi) to the native dpi of screen on the device where the application is run.

This function is mainly used to perform a positioning at pixel level.

Versions 21 and later

This function is now available in Universal Windows 10 App mode.

This function is now available for the WINDEV applications in Windows and in Linux.

New in version 21

This function is now available in Universal Windows 10 App mode.

This function is now available for the WINDEV applications in Windows and in Linux.

This function is now available in Universal Windows 10 App mode.

This function is now available for the WINDEV applications in Windows and in Linux.

Versions 24 and later

This function is now available for the WEBDEV sites in Windows.

This function is available only to simplify the Webification of WINDEV projects.

New in version 24

This function is now available for the WEBDEV sites in Windows.

This function is available only to simplify the Webification of WINDEV projects.

This function is now available for the WEBDEV sites in Windows.

This function is available only to simplify the Webification of WINDEV projects.

Example

// Draws a square that will "visually" have the same position and the same size // regardless of the screen dpidStartDrawing(IMG_DRAWING)nX1 is int = CoordinateEditorToScreen(50)nY1 is int = CoordinateEditorToScreen(50)nX2 is int = CoordinateEditorToScreen(150)nY2 is int = CoordinateEditorToScreen(150)dRectangle(nX1, nY1, nX2, nY2)

Syntax

<Result> = CoordinateEditorToScreen(<Value>)

<Result>: Integer

Conversion result: size or position converted into the native dpi of device screen.

This parameter always corresponds to <Value>.

<Value>: Integer

Value to convert: size or position specified in the reference dpi in the editor (160 dpi).

Remarks

In the editor, the sizes and positions of controls in the Android, iPhone or Windows Mobile windows always correspond to a screen in 160 dpi (dot per inch). In the editor, the sizes and positions of controls in the Android, iPhone, Universal Windows 10 App or Windows Mobile windows always correspond to a screen in 160 dpi (dot per inch).

When running the application, these sizes and positions are automatically converted according to the native dpi of the screen on the host device. This allows you to get a WYSIWYG rendering regardless of the device dpi.For example, if the size of a control is equal to 100x100 in the editor, its size at run time will be set to 150x150 on a device in 240 dpi, to 200x200 on a device in 320 dpi, etc.

CoordinateScreenToEditor makes it possible to make the inverted conversion, i.e., go grom the native dpi of the screen on the device where the application is run to the reference dpi in the editor (160 dpi).

CoordinateEditorToScreen must not be used with the drawing functions. Indeed, the DPI of the device may differ from the scale factor used by the drawing functions.