Form - ScaledLayout (на нем другие компоненты) при Resize Form всё должно работать
нуууу.... или так:
var
constWidth, constHeight:integer;
koef, koefv, koef1:double;
right_w:integer=320;
change:boolean=true;
procedure TForm1.FormCreate(Sender: TObject);
begin
constWidth:=form1.ClientWidth;
constHeight:=Form1.ClientHeight;
koef:=constWidth/constHeight;
koef1:=koef;
koefv:=right_w/constWidth ;
end;
procedure TForm1.FormResize(Sender: TObject);
begin
if change then begin
ScaledLayout1.Scale.x:=Form1.ClientWidth/constWidth;
ScaledLayout1.Scale.y:=Form1.ClientHeight/constHeight;
end;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
form1.ClientWidth:= round(form1.ClientHeight*koef);
// Form1.Caption:=inttostr(form1.ClientWidth);
end;
procedure TForm1.FormResize(Sender: TObject);
begin
if change then begin
ScaledLayout1.Scale.x:=Form1.ClientWidth/constWidth;
ScaledLayout1.Scale.y:=Form1.ClientHeight/constHeight;
end;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
form1.ClientWidth:= round(form1.ClientHeight*koef);
// Form1.Caption:=inttostr(form1.ClientWidth);
end;