Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. using (MagickImage image = new MagickImage(ssimageBinary))
  2. {
  3. image.Density = new Density(sstargetDensity);
  4. MagickGeometry size = new MagickGeometry(sstargetWidth, sstargetHeight);
  5.  
  6. // This will resize the image to a fixed size without maintaining the aspect ratio.
  7. // Normally an image will be resized to fit inside the specified size.
  8. size.IgnoreAspectRatio = ssKeepAspectRatio;
  9.  
  10. image.Resize(size);
  11.  
  12. MemoryStream mStream = new MemoryStream();
  13.  
  14. // Save the result
  15. image.Write(mStream, MagickFormat.Png);
  16.  
  17. ssnewImage = mStream.ToArray();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement