JPEG Resize

  • Thread starter Thread starter Anderson Calos Parucker
  • Start date Start date
A

Anderson Calos Parucker

I neet to resize an JPEG image and save it to disk.

How I do this ?!

Is there any class for JPEG images ?


thanks

Anderson
 
Anderson,

Its not that hard, although it is a little involved.

First, you will have to create a new bitmap with the same bits per
pixel, and the new size that you want it. Once you do that, you can pass
that to the static FromImage method on the Graphics class to get a Graphics
instance to draw on the bitmap. Call DrawImage, passing the original image,
and the new size you want to draw it at (which is the size of the new
bitmap). Finally, you can call Save, passing a FileStream to it
representing the location you want to save it at.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top