Using objEncoderParams when saving an image

D

darrel

I'm currently saving a JPG file as such:

imgOutput.Save("path/filename.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)

That saves the imgOutput as a JPG to the path shown.

Works fine.

Now, I'd like to change the JPG compression it uses. I apparently can do
that with an EncoderParameter:

Dim objEncoderParams As New EncoderParameters(1)
objEncoderParams.Param(0) = New EncoderParameter(Encoder.Quality, 500)
imgOutput.Save("path/filename.jpg", *encoder*, objEncoderParams)

What I'm stuck on is the 'encoder' value. What do I put there to? I assume I
need to tell it to use the JPG encoder, right? If so, I'm stuck on the
syntax.

-Darrel
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top