title: Resize images and save output
body: <p>I see many questions/Answers about resizing images here on SO.</p>
  
  <p>But I can't find the correct one that fit my case.</p>
  
  <p><strong><a href="https://stackoverflow.com/questions/8111447/how-to-resize-a-picture">In this post</a></strong>, it works only when you want to have a small image from a big one.</p>
  
  <p>However if you have a picture with 24x24 dimension and you want to resize it to 256x256 dimension, the <code>procedure</code> will fail and gives you a distorted picture.</p>
  
  <p>The code below is my attempt to sort out my issue</p>
  
  <pre><code>  Graph := TBitmap.Create;
    try   // After loading a .bmp file to Image1 with 48x48 dimension 
      Graph.Assign( Image1.Picture.Bitmap );
      Graph.Canvas.StretchDraw(Rect(0, 0, 255, 255), Graph);
      Graph.SetSize(255,255);
      Graph.SaveToFile('Location\Resault.bmp');
    finally
      Graph.Free;
    end;
  </code></pre>
  
  <p>The original image:</p>
  
  <p><a href="https://i.stack.imgur.com/jo7zP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jo7zP.png" alt="enter image description here"></a></p>
  
  <p>The result (the white square with the black part on the upper left):</p>
  
  <p><a href="https://i.stack.imgur.com/IGgmg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IGgmg.png" alt="enter image description here"></a></p>
  
  <p>How can we load an image to a <code>TImage</code> and convert/resize it and save changes?</p>