procedure TForm1.TrackBar1Change(Sender: TObject); begin if TrackBar1.Position=0 then begin image1.Width:=x; image1.Height:=y; Exit; end; image1.Width:=Ceil(x*( TrackBar1.Position)); image1.Height:=Ceil(y*( TrackBar1.Position)); image1.Top:=Ceil(1/2*(Self.Height-image1.Height)); Image1.Left:=Ceil(1/2*(Self.Width-image1.Width)); end;
procedure TForm1.FormShow(Sender: TObject); begin x:=image1.Width; y:=image1.Height; image1.Top:=Ceil(1/2*(Self.Height-image1.Height)); Image1.Left:=Ceil(1/2*(Self.Width-image1.Width)); end;