Hello everybody,
I recently opened a thread asking how you could scale the tool's window proportional to the resolution of the client (windows). I was pointed to an external component TFormResizer (EasySize) with which I could resize the image based on the resolution. All the components on my form (Buttons) did also resize.
Now I wanted to expand on that a little by also detecting the zoom (don't know if it's called DPI Scalling, in windows settings it's called "change the size of text apps and other items") and setting a secreen resolution based on that.
My code so far:
procedure TForm1.FormCreate(Sender: TObject);
begin
Sizer := TFormResizer.Create(self);
Sizer.EnforceMinSize := false;
Sizer.ResizeFonts := true;
Sizer.MinFontSize := 6;
Sizer.MaxFontSize := 30;
Sizer.InitializeForm;
Width := round(Screen.Width/2.4);
Height := round(Screen.Height/2.4);
Position := poScreenCenter;
end;
I want to change the code to something like this.
if Zoom=100% then
begin
Width := round(Screen.Width/2.4);
Height := round(Screen.Height/2.4);
end;
else if Zoom=125% then
begin
Width := round(Screen.Width/2.8);
Height := round(Screen.Height/2.8);
end;
...
The only problem I have is that I don't know how to detect the Zoom-factor.