blah blah blah is here! blah blah » Close

up0down
link

Hi,
I have lots of images that I need to resize to various dimensions.
I need some help creating a function that will resize a image to a fixed dimension (length and width).
Does anyone know how to code such a function?
I will then loop through all my files and rename them and use the function to resize them one by one.

last answered 2 years ago

1 answers

up0down
link

Bitmap bmp = new Bitmap(unscaledImage, newWidth, newHeight);

up0down
link

then you can save it to a file using its save method:
bmp.Save("newImage.jpg", ImageFormat.Jpeg);

This post was imported from csharpfriends, if you have a similiar question please ask it again.

All previous members have been migrated, hope you enjoy the new platform!

Feedback