ImageCodecs sample
[mono.git] / mcs / class / System.Drawing / Samples / System.Drawing.Imaging / ImageCodecs.cs
1 //
2 // Sample application for encoder/decoder
3 //
4 // Author:
5 //   Jordi Mas i Hernàndez, jordi@ximian.com
6 //
7
8 using System;
9 using System.Drawing;
10 using System.Drawing.Drawing2D;
11 using System.Drawing.Imaging;
12
13 //
14 public class SampleImageCodecs
15 {       
16         public static void DumpCodeInfo (ImageCodecInfo codec)
17         {
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);                 
27         }
28         
29         public static void Main(string[] args)
30         {       
31                 ImageCodecInfo[] decoders =  ImageCodecInfo.GetImageDecoders();                 
32                 ImageCodecInfo[] encoders =  ImageCodecInfo.GetImageEncoders();                 
33         
34                 Console.WriteLine ("Encoders ********");
35                 
36                 for (int i = 0; i < encoders.Length; i++) {
37                         DumpCodeInfo (encoders[i]);
38                         Console.WriteLine ("---");
39                 }
40
41                 Console.WriteLine ("Decoders ********");
42                 
43                 for (int i = 0; i < decoders.Length; i++) {
44                         DumpCodeInfo (decoders[i]);
45                         Console.WriteLine ("---");
46                 }
47         }
48
49 }
50
51