Mark,
If you are interested in shrinking the size of the image by 30%, you
could use the GetThumbnailImage method on the Image class to resize the
image.
However, you have to be careful. If your image contains thumbnail data,
then it will use that and possibly scale it up (which results in a much
larger loss of quality usually than scaling down).
If there is no data in the thumbnail image, then the Image class will
just scale the image down, and that would work.
If there is thumbnail data, you will have to create a new Bitmap at the
appropriate size, and then draw the current image onto the new one (there
are methods on the DrawImage method on the Graphics class which will handle
the scaling for you).
It should also be noted that the quality of GDI+ (which the Graphics
instance is based on), is generally crap. You might not get the quality you
are looking for, and might have to look for a third party solution.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Mark" <ma**@nojunkmail.com> wrote in message
news:Ol**************@TK2MSFTNGP10.phx.gbl...
Sorry for not being precise. I'm interested in shrinking the size of the
image. Thanks again.
Mark
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:ed**************@TK2MSFTNGP14.phx.gbl... Mark,
Are you talking about shrinking in terms of the size of the file, or
the size of the image, or are you looking to change the compression rate
of the JPEG? Which is it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Mark" <ma**@nojunkmail.com> wrote in message
news:uQ**************@tk2msftngp13.phx.gbl... I'd like to automate the process of shrinking .jpg files using C#. I'd
like to point at 1000 files, shrink them to 30%, and then resave the new
files. I've seen the Graphics.DrawImage method, but this appears to be
used for display only?
What classes/method would be most useful?
Thanks in advance.
Mark