High Resolution Delphi Firemonkey Scale for Windows

I thought scaling an application in FireMonkey should be easy, as it should work with Retina-Mac too. There seems to be some background magic that chooses a different style than, but it doesn't look like Windows.

In VCL, there was TForm.Scaled that does the job (more or less).

For FireMonkey, I found this Embarcadero article , but it seems that Embarcadero is not entirely sure if this approach is useful, since in XE5 the β€œControlsDemo” sample project does not contain a zoom bar anymore. It also requires root-TLayout in all forms for which a scale factor can be set. I don't have such an element in my forms (and I'm afraid to add it, because I cannot be sure that I am launching another firemonkey error than).

So, how do I explain the various DPI settings with FireMonkey?

Edit: I tried to hack TPlatFormWin and set CurrentScreenScale to 2, but that didn’t work: I have black toolbars but no scaling, but at least he used the HighRes alternative from the provided TImage.MultiResBitmap.

+7
delphi firemonkey delphi-xe5
source share
2 answers

U could do something like this to change the root of the TLayout:

when 100 is the default

if windowsscale>0 then begin LayoutScale.height:=ClientHeight*100/windowsscale; LayoutScale.Width :=Clientwidth*100/windowsscale; LayoutScale.Scale.X:=windowsscale/100; LayoutScale.Scale.Y:=windowsscale/100; end; 
0
source share

If someone reads this ... my experience with Windows Desktop Firemonkey is that you have to take care of setting up the DPI OS manually, and it's fine to put your controls in a top container (TLayout) that scales to fit OS OS DPI settings (defined using low-level code). However, there are times when you need to cancel this scaling - for example, Viewport3D must be reduced back 1 / X in order to correctly display inside the extended container. Otherwise, pixel level artifacts will be shown, image quality will be terrible. This zoom / zoom technology works well.

0
source share

All Articles