Skip to content

omuleanu/imager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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))

About

image resizing and cropping

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages