image resizing and cropping
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md

README.md

get via nuget Omu.Drawing2

download dll here

add using:

using Omu.Drawing;

cropping

Image img = Imager.Crop(sourceImage, new Rectangle(x, y, width, height));

resizing

resize an image and maintain aspect ratio

Image img = Imager.Resize(sourceImage, newWidth, maxHeight, onlyResizeIfWider);

save

Imager.Save(path, img, Imager.GetEncoderInfo("image/gif"));
// image/gif is the MIME type for gif`

save as jpeg

Imager.SaveJpeg(path, img);

put on canvas

the image remains the same size, and it is placed in the middle of the new canvas

Imager.PutOnWhiteCanvas(img, width, height))
// or
Imager.PutOnCanvas(img, width, height, Color.White))