Intrinsic - 146 SetScreenScale

Top  Previous  Next

146: SetScreenScale(ScaleFactor);

 

This intrinsic sets a scaling factor for screen. It magnifies or shrinks the text and graphics on the screen. Scale Factors greater than one magnify the display.  Scale Factors less than one shrink the display.

 

The intrinsic is used to compensate for the high resolution of modern graphics cards and monitors. The EXPL display can have a wide range of resolutions from 160 X 200 to 1600 X 1200, depending on the video mode. At the same time, the best graphics cards support 4K HD resolution such as 4096 X 2160 and Ultra HD resolutions up to 7680 x 4320. This means in 320 x 200 mode, an XPL program might only take up 7% of the screen, way too small to be useful.

 

As an example, let's say Windows was configured to use 1920 x 1200, which is a standard wide-screen format. Running in video mode $13, at 320 x 200, the XPL working surface would only take up 16% of the horizontal and vertical space. An image that small would be difficult to work with. However, setting the scale factor to three, increases the image to just under half the screen, which is large enough for each viewing.

 

For maximum compatibility, you should set the Screen Scale based on the resolution of the display. You can calculate the current screen resolution using the follow code:

 

int Width, Height;

 

GetBitmapSize(-1, @Width, @Height);