Resize an image in .NET core

.NET

Install the SixLabors.ImageSharp package

Load the image


using MemoryStream memStream = new (imgBytes);
using Image image = Image.Load(memStream);

Do the resize action


image.Mutate(x => x.Resize(400, 400));

Save the result


using MemoryStream outStream = new ();
image.Save(outStream);

Post a Comment

Previous Post Next Post