title: How to fit image sizes correctly using Magick.NET?
body: <p>I'm using Magick.NET to generate some images for a splash screen for Android and iOS.</p>
  
  <p>But I'm having some issues with the resize. </p>
  
  <p>We can have a square or rectangle image and portrait or landscape but when I convert it stretches.</p>
  
  <pre class="lang-cs prettyprint-override"><code>using (MagickImage image = new MagickImage(ssimageBinary))
  {
      image.Density = new Density(sstargetDensity);
      MagickGeometry size = new MagickGeometry(sstargetWidth, sstargetHeight);
  
      // This will resize the image to a fixed size without maintaining the aspect ratio.
      // Normally an image will be resized to fit inside the specified size.
      size.IgnoreAspectRatio = ssKeepAspectRatio;
  
      image.Resize(size);
  
      MemoryStream mStream = new MemoryStream();
  
      // Save the result
      image.Write(mStream, MagickFormat.Png);
  
      ssnewImage = mStream.ToArray();
  }
  </code></pre>
  
  <p>Can anyone help me with this? This picture shows what I get, and what I want.</p>
  
  <p><a href="https://i.stack.imgur.com/Swc6X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Swc6X.png" alt="enter image description here"></a></p>