title: GIF animation TImage/Timage32
body: <p>The goal is to have animated GIFs playing inside image components with good image quality even after resizing one of the image components.</p>
  
  <h2>TImage example</h2>
  
  <p>This is the resized <code>TImage</code>, very bad image quality but flawless animation:</p>
  
  <p><a href="https://i.stack.imgur.com/5WMaD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5WMaD.png" alt="timage example"></a></p>
  
  <pre><code>// GIF = TGIFImage
  // TImage = TImage
  GIF.Animate := True;
  TImage.Stretch := True;
  TImage.Proportional := True;
  TImage.Picture.Assign(GIF);
  </code></pre>
  
  <h2>TImage32 example</h2>
  
  <p>This is a resized <code>TImage32</code> from the graphics32 library, very good image quality but no animation at all, only the first frame ist visible:</p>
  
  <p><a href="https://i.stack.imgur.com/j1EXV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j1EXV.png" alt="graphics32 example"></a></p>
  
  <pre><code>// GIF = TGIFImage
  // TImage32 = TImage32
  GIF.Animate := True;
  TImage32.ScaleMode := smResize;
  TImage32.BitmapAlign := baCenter;
  TImage32.Bitmap.Assign(GIF);
  </code></pre>
  
  <p>I need to have the <code>TImage32</code> component play the animation or for the <code>TImage</code> component to have better resampling.</p>