procedure TForm1.FormResize(Sender: TObject);
var
i, highR: integer;
begin
highR := 0;
for i := 0 to screen.MonitorCount - 1 do
begin
if Screen.Monitors[i].BoundsRect.Right > highR then
highR := Screen.Monitors[i].WorkareaRect.Right;
Writeln('Highest Right: ' + IntToStr(highR));
end;
scaleLObyXY := pnlLayout.Width / int64(highR);
scaleTocntrX := pnlLayout.Width div 4;
scaleTocntrY:=pnlLayout.Height div 4;
for i := 0 to Screen.MonitorCount - 1 do
begin
schDisplays[i].Left := (trunc(Screen.Monitors[i].Left * scaleLObyXY) div
2) + scaleTocntrX;
schDisplays[i].Top := (trunc(Screen.Monitors[i].Top * scaleLObyXY) div 2) + scaleTocntrY;
schDisplays[i].Width := (trunc(Screen.Monitors[i].Width * scaleLObyXY) div 2);
schDisplays[i].Height := (trunc(Screen.Monitors[i].Height * scaleLObyXY) div 2);
end;
end;