2 // Sample application for encoder/decoder
5 // Jordi Mas i Hernàndez, jordi@ximian.com
10 using System.Drawing.Drawing2D;
11 using System.Drawing.Imaging;
14 public class SampleImageCodecs
16 public static void DumpCodeInfo (ImageCodecInfo codec)
18 Console.WriteLine ("Clsid:" + codec.Clsid);
19 Console.WriteLine ("FormatID:" + codec.FormatID);
20 Console.WriteLine ("Codec:" + codec.CodecName);
21 Console.WriteLine ("DllName:" + codec.DllName);
22 Console.WriteLine ("Extension:" + codec.FilenameExtension);
23 Console.WriteLine ("Format:" + codec.FormatDescription);
24 Console.WriteLine ("MimeType:" + codec.MimeType);
25 Console.WriteLine ("Flags:" + codec.Flags);
26 Console.WriteLine ("Version:" + codec.Version);
29 public static void Main(string[] args)
31 ImageCodecInfo[] decoders = ImageCodecInfo.GetImageDecoders();
32 ImageCodecInfo[] encoders = ImageCodecInfo.GetImageEncoders();
34 Console.WriteLine ("Encoders ********");
36 for (int i = 0; i < encoders.Length; i++) {
37 DumpCodeInfo (encoders[i]);
38 Console.WriteLine ("---");
41 Console.WriteLine ("Decoders ********");
43 for (int i = 0; i < decoders.Length; i++) {
44 DumpCodeInfo (decoders[i]);
45 Console.WriteLine ("---");