2 // System.Drawing.Imaging.ImageFormat.cs
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)
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:
24 // The above copyright notice and this permission notice shall be
25 // included in all copies or substantial portions of the Software.
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.
37 using System
.ComponentModel
;
39 namespace System
.Drawing
.Imaging
{
41 [TypeConverter (typeof (ImageFormatConverter
))]
42 public sealed class ImageFormat
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"));
58 public ImageFormat (Guid guid
)
65 public override bool Equals(object o
) {
68 if ( ((ImageFormat
)o
).Guid
.Equals(this.Guid
))
75 public override int GetHashCode()
77 return guid
.GetHashCode();
81 public override string ToString()
83 if (Guid
.Equals (Bmp
.Guid
))
86 if (Guid
.Equals (Emf
.Guid
))
89 if (Guid
.Equals (Gif
.Guid
))
92 if (Guid
.Equals (Jpeg
.Guid
))
95 if (Guid
.Equals (MemoryBmp
.Guid
))
98 if (Guid
.Equals (Png
.Guid
))
101 if (Guid
.Equals (Tiff
.Guid
))
104 if (Guid
.Equals (Wmf
.Guid
))
108 return guid
.ToString ();
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; }