title: Resizing a Image to selection rectangle Delphi
body: <p>Hi i cant figure out why this wont work.
  I have a image and a selection and i want the image to always be the same size and position as the selection so i put this code in a timer:</p>
  
  <pre><code>  procedure TfrmMainUI.tmrUpdateTimer(Sender: TObject);
    var i : integer; 
    begin
      Image1.Width:=Selection1.Width;
      Image1.Height:=Selection1.Height;
      Image1.Position.X:=Selection1.Position.X;
      Image1.Position.Y:=Selection1.Position.Y;
    end;
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>What is supposed to happen is the image resizes to the selection and its position also follows the selection.
  But what happens is that i can move and resize the selection and the image just stays where it is and doesn't resize.</p>
  
  <p><img src="https://i.stack.imgur.com/fjOdx.png" alt="Image stays where it is"></p>