SYS(8006) - High resolution support
|Top Previous Next|
Provides support for high resolution screens when forms have been designed for a lower resolution. All Guineu specific coordinates are multiplied with the factor before passing them on to the operating system.
SYS( 8006 [,nScale] )
Specifies the new scale factor. This can be any number including fractions. The default value is 1.
Returns a numeric value as a character string with the current scale factor. If you don't pass a second parameter, Guineu returns the scale factor without changing it.
Windows CE versions prior to Windows 2003 SE supported only one fixed resolution which usually was 240x320. Later versions offer higher resolution with Windows Mobile 6.1 supporting up to 800x480.
EXE files on compact devices contain a flag which indicates wether an application was written for QVGA (240x320) or a higher resolution (480x640 or higher). This HI_RES flag is not set for EXEs compiled by GuineuIDE. Guineu.compact.EXE, on the other hand, has the HI_RES flag set.
When an EXE specifies this flag, the entire area on the display is available in its highest resolution. Applications have to resize forms and controls accordingly. As with large fonts on the desktop machine, the number of pixels per point for fonts changes on high resolution displays. That means, a nine point is displayed with twice as many pixels on a VGA display compared to a QVGA display. When you create high resolution applications, you need to take this into account. High resolution applications are currently only possible when using Guineu.Compact.EXE or patching the generated EXE manually.
EXE that do not specify the HI_RES flag, as all GuineuIDE compiled applications do, do not notice that they are running on a high resolution device. The screen size reported by SYSMETRIC() is 240x320. Every pixel drawn by such an application is automatically quadrupled and drawn as a 2x2 pixel square. Consequently, the application still covers the entire display. Only graphics and some controls are now shown as crisp as with high resolution applications.
Under normal conditions, you wouldn't need to worry about this. Any application created with GuineuIDE needs tohave forms sized for 240x320. They show up the same on every Windows Mobile device no matter what the resoolution is.
Unfortunately, though, some PDAs (mainly HP devices) seem to ignore the absence of the HI_RES flag. They assume that every application is high resolution aware. As a result, Guineu forms only occupy the upper left quarter of the screen and most captions are unreadable.
As a work around for such devices, you can use SYS(8006) to specify a scale factor. Every pixel in Guineu controls are automatically multiplied by this factor. So if a button is 100 pixels wide and 30 pixels high, it's drawn on high resolution devices with 200 pixels by 60 pixel. In other words, Guineu performs the scaling that the operating system would otherwise do. To achieve the optimium result, use the following code at the beginning of your application:
lnScale = SYSMETRIC(2)/320
This feature is optional. If you have a device that treats Guineu applications as high-resolution aware, you can also create forms with the device's resolution. Just make sure that the font size is adjusted apopriately.
The new scale factor applies to any pixel oriented operation that is executed afterwards. Existing forms and controls are not resized.
SYS(8006) is only available with the Microsoft Compact Framework. The function is ignored on any platform other than Windows Mobile.