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, ...
Get Graphics Programming with GDI+ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.