Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Writing a real DPI-aware VFP application
Message
De
10/02/2021 08:30:21
 
 
À
05/02/2021 17:15:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01678100
Message ID:
01678156
Vues:
124
J'aime (2)
A second, illustrated, update.

I created a project to test the DPI manager class. When the project is built, it links into the executable a DPI aware manifest that supports multiple monitors with different DPI scales.

The test program turns off the visibility of the _Screen, and launches two identical resizeable top level forms. These forms are just displaying information to help monitoring the process.

For the test, I used two monitors: the main one is set to DPI 96, 100%, while the second is set to DPI 144, 150% (both are recommended settings).

Figure 1 displays the two forms close to the right edge of the main monitor. The background image of the second monitor can already be seen on the right. Both forms are displaying at 100%, and their borders are completely within the boundaries of the main monitor.

In Figure 2, Form #2 has started to being dragged into the second High DPI monitor. But since most of the form still lies within the main monitor, no changes have been made: it still displays at 100%.

In Figure 3, Form #2 has now most of its area in the second monitor, and its contents have been adjusted to the 150% scaling of the monitor. During this process, Form #1 was left unchanged because it didn't crossed between monitors.

In Figure 4, the forms are in different monitors, each one of them scaled to user's preferences.

Figure 5 demonstrates that forms resizing can be done without the DPI manager intervening. Textboxes are anchored so that may stretch while the window resizes outside the scaling process.

In Figure 6, Form #2 returned to main monitor. The process of changing monitors in a form, for now, resets the dimensional and positional properties to the values adjusted to the DPI scale, but in the future it will take in consideration also the current values of those properties (the window may have been resized between its creation and the movement).

The forms do not know in what monitor they are being displaying, although the DPI manager stores in the form a property with a monitor identifier. Scaling is being controlled and performed by the DPI manager at the application level, and any action is considered at the Moved event that is bound to a method in the manager.
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform