O'Reilly logo

Graphics Programming with GDI+ by Mahesh Chand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8.5. Encoder Parameters and Image Formats

In Chapter 7 we discussed how the Save method of the Image class can be used to save images in different formats. This is what our code in Chapter 7 looked like to save an image as a TIFF file:

curImage.Save(fileName, ImageFormat.Tiff);

In fact, the Save method does much more than just save an image in different formats. An overloaded Save method can take an argument of type EncoderParameters, which represents an encoder. An encoder is responsible for converting a file from one format to another, and a decoder reverses it. The encoder is responsible for saving an image to a format defined by codec parameters.

Two forms of the Save method with EncoderParameters are

 public void Save(Stream, ImageCodecInfo, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required