(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Drawing / System.Drawing.Imaging / ImageFormat.cs
blob76d31a4ec83b13a5d352b3a04128f6af73d56e4e
1 //
2 // System.Drawing.Imaging.ImageFormat.cs
3 //
4 // Authors:
5 // Everaldo Canuto (everaldo.canuto@bol.com.br)
6 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
7 // Dennis Hayes (dennish@raytek.com)
8 // Jordi Mas i Hernandez (jordi@ximian.com)
9 //
10 // (C) 2002-4 Ximian, Inc. http://www.ximian.com
14 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
16 // Permission is hereby granted, free of charge, to any person obtaining
17 // a copy of this software and associated documentation files (the
18 // "Software"), to deal in the Software without restriction, including
19 // without limitation the rights to use, copy, modify, merge, publish,
20 // distribute, sublicense, and/or sell copies of the Software, and to
21 // permit persons to whom the Software is furnished to do so, subject to
22 // the following conditions:
23 //
24 // The above copyright notice and this permission notice shall be
25 // included in all copies or substantial portions of the Software.
26 //
27 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 using System;
37 using System.ComponentModel;
39 namespace System.Drawing.Imaging {
41 [TypeConverter (typeof (ImageFormatConverter))]
42 public sealed class ImageFormat
44 private Guid guid;
45 private static ImageFormat BmpImageFormat = new ImageFormat (new Guid ("b96b3cab-0728-11d3-9d7b-0000f81ef32e"));
46 private static ImageFormat EmfImageFormat = new ImageFormat (new Guid ("b96b3cac-0728-11d3-9d7b-0000f81ef32e"));
47 private static ImageFormat ExifImageFormat = new ImageFormat (new Guid ("b96b3cb2-0728-11d3-9d7b-0000f81ef32e"));
48 private static ImageFormat GifImageFormat = new ImageFormat (new Guid ("b96b3cb0-0728-11d3-9d7b-0000f81ef32e"));
49 private static ImageFormat TiffImageFormat = new ImageFormat (new Guid ("b96b3cb1-0728-11d3-9d7b-0000f81ef32e"));
50 private static ImageFormat PngImageFormat = new ImageFormat(new Guid("b96b3caf-0728-11d3-9d7b-0000f81ef32e"));
51 private static ImageFormat MemoryBmpImageFormat = new ImageFormat (new Guid ("b96b3caa-0728-11d3-9d7b-0000f81ef32e"));
52 private static ImageFormat IconImageFormat = new ImageFormat (new Guid ("b96b3cb5-0728-11d3-9d7b-0000f81ef32e"));
53 private static ImageFormat JpegImageFormat = new ImageFormat(new Guid("b96b3cae-0728-11d3-9d7b-0000f81ef32e"));
54 private static ImageFormat WmfImageFormat = new ImageFormat (new Guid ("b96b3cad-0728-11d3-9d7b-0000f81ef32e"));
57 // constructors
58 public ImageFormat (Guid guid)
60 this.guid = guid;
64 // methods
65 public override bool Equals(object o) {
67 if (o is ImageFormat)
68 if ( ((ImageFormat)o).Guid.Equals(this.Guid))
69 return true;
70 return false;
75 public override int GetHashCode()
77 return guid.GetHashCode();
81 public override string ToString()
83 if (Guid.Equals (Bmp.Guid))
84 return "Bmp";
86 if (Guid.Equals (Emf.Guid))
87 return "Emf";
89 if (Guid.Equals (Gif.Guid))
90 return "Gif";
92 if (Guid.Equals (Jpeg.Guid))
93 return "Jpeg";
95 if (Guid.Equals (MemoryBmp.Guid))
96 return "MemoryBmp";
98 if (Guid.Equals (Png.Guid))
99 return "Png";
101 if (Guid.Equals (Tiff.Guid))
102 return "Tiff";
104 if (Guid.Equals (Wmf.Guid))
105 return "Wmf";
107 // Default
108 return guid.ToString ();
112 // properties
113 public Guid Guid
115 get { return guid; }
119 public static ImageFormat Bmp
121 get { return BmpImageFormat; }
125 public static ImageFormat Emf
127 get { return EmfImageFormat; }
131 public static ImageFormat Exif
133 get { return ExifImageFormat; }
137 public static ImageFormat Gif
139 get { return GifImageFormat; }
143 public static ImageFormat Icon
145 get { return IconImageFormat; }
149 public static ImageFormat Jpeg
151 get { return JpegImageFormat; }
155 public static ImageFormat MemoryBmp
157 get { return MemoryBmpImageFormat; }
161 public static ImageFormat Png
163 get { return PngImageFormat; }
167 public static ImageFormat Tiff
169 get { return TiffImageFormat; }
173 public static ImageFormat Wmf
175 get { return WmfImageFormat; }