Requires: GfaWinx.lg32
Scales ScaleLeft, ScaleTop, ScaleWidth, and ScaleHeight to a form's DPI.
ScaleXYWHToDpi(frm [, dpi%][, Left96!][, Top96!][, Width96!][, Height96!])
frm | : Form object |
dpi% | : iexp |
Left96!, Top96!, Width96!, Height96! | : single |
This command is used to scale the form's client area coordinates to the form's display DPI. After executing this command the GFA-BASIC's graphical commands can use coordinates from the 96-dots-per-inch pixel coordinate system. The application does not need to apply scaling to each separate GB drawing command itself, because ScaleXYWHToDpi scales the width and height of the client area to the form's DPI by adjusting the ScaleWidth and ScaleHeight properties. By default, the origin ScaleLeft, ScaleTop is (0, 0), unless Left96! And Top96! specify a new value for the origin (note that the ScaleLeft and ScaleTop use negative values to move it in the x- and y-direction). If the parameters Width96! and/or Height96! are used the ScaleWidth and ScaleHeight are scaled to the form's DPI and the number of units specified. The parameters must always specify pixel coordinates as if they are used in the 96-dots-per-inch coordinate system. ScaleXYWHToDpi calculates the real number of physical pixels for a (high-resolution) display.
GFA-BASIC takes negative values when transforming the origin to the right and bottom. Setting the origin to (10,10) requires the values -10, -10. This is how GB handles ScaleLeft and ScaleTop (probably a bug).
DpiAwareness, ScaleToDpi, ScaleToDpiSng, WM_DPICHANGED, ScaleLeft, ScaleTop, ScaleWidth, ScaleHeight
{Created by Sjouke Hamstra; Last updated: 23/02/2022 by James Gaite}