sw4all 0 Posted February 17, 2020 (edited) Hi,I have a TImageViewer component on my form.At runtime, I create the TRectangle component and place it in ImageViewer.Now I need the Rectangle component to be automatically resized (Height and Width)by ImageViewer.BitmapScale and also to move in the correct position X and Y.Please help.Thank you StartPositionX := 1032; // rectangle1.Position.X StartPositionY := 304; // rectangle1.Position.Y procedure TfrmMain.ImageViewer1CalcContentBounds(Sender: TObject; var ContentBounds: TRectF); begin rectangle1.Scale.X := imgNahled.BitmapScale; rectangle1.Scale.Y := imgNahled.BitmapScale; rectangle1.Position.X := StartPositionX * imgNahled.BitmapScale; rectangle1.Position.Y := StartPositionY * imgNahled.BitmapScale; end; Edited February 17, 2020 by sw4all Share this post Link to post