2 // System.Drawing.Imaging.ImageCodecInfo.cs
5 // Everaldo Canuto (everaldo.canuto@bol.com.br)
6 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
7 // Dennis Hayes (dennish@raytek.com)
8 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
9 // Dennis Hayes (dennish@raytek.com)
10 // Jordi Mas i Hernandez (jordi@ximian.com)
12 // (C) 2002 Ximian, Inc. http://www.ximian.com
16 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
18 // Permission is hereby granted, free of charge, to any person obtaining
19 // a copy of this software and associated documentation files (the
20 // "Software"), to deal in the Software without restriction, including
21 // without limitation the rights to use, copy, modify, merge, publish,
22 // distribute, sublicense, and/or sell copies of the Software, and to
23 // permit persons to whom the Software is furnished to do so, subject to
24 // the following conditions:
26 // The above copyright notice and this permission notice shall be
27 // included in all copies or substantial portions of the Software.
29 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
32 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
33 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
34 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
35 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 using System.Runtime.InteropServices;
40 using System.Collections;
41 using System.Collections.Specialized;
42 using System.Configuration;
44 using Mainsoft.Drawing.Imaging;
46 using imageio = javax.imageio;
47 using spi = javax.imageio.spi;
49 namespace System.Drawing.Imaging {
52 public sealed class ImageCodecInfo
55 private string codecName;
56 private string dllName;
57 private string filenameExtension;
58 private ImageCodecFlags flags;
59 private string formatDescription;
60 private Guid formatID;
61 private string mimeType;
62 private byte[][] signatureMasks;
63 private byte[][] signaturePatterns;
66 public static ImageCodecInfo[] GetImageDecoders ()
68 Hashtable oldInfo = ImageCodec.Decoders;
69 ImageCodecInfo [] newInfo = new ImageCodecInfo [oldInfo.Count];
71 foreach (ImageCodecInfo codec in oldInfo.Values) {
72 newInfo [i++] = (ImageCodecInfo) codec.MemberwiseClone ();
77 internal ImageCodecInfo () {
80 public static ImageCodecInfo[] GetImageEncoders ()
82 Hashtable oldInfo = ImageCodec.Encoders;
83 ImageCodecInfo [] newInfo = new ImageCodecInfo [oldInfo.Count];
85 foreach (ImageCodecInfo codec in oldInfo.Values) {
86 //newInfo [i++] = (ImageCodecInfo) codec.MemberwiseClone ();
87 newInfo [i] = new ImageCodecInfo ();
88 newInfo [i].clsid = codec.clsid;
89 newInfo [i].formatID = codec.formatID;
90 newInfo [i].codecName = codec.codecName;
91 newInfo [i].dllName = codec.dllName;
92 newInfo [i].flags = codec.flags;
93 newInfo [i].filenameExtension = codec.filenameExtension;
94 newInfo [i].formatDescription = codec.formatDescription;
95 newInfo [i].mimeType = codec.mimeType;
96 newInfo [i].signatureMasks = codec.signatureMasks;
97 newInfo [i].signaturePatterns = codec.signaturePatterns;
98 newInfo [i++].version = codec.version;
107 get { return clsid; }
108 set { clsid = value; }
112 public string CodecName
114 get { return codecName; }
115 set { codecName = value; }
119 public string DllName
121 get { return dllName; }
122 set { throw new NotSupportedException(); }
126 public string FilenameExtension
128 get { return filenameExtension; }
129 set { filenameExtension = value; }
133 public ImageCodecFlags Flags
135 get { return flags; }
136 set { flags = value; }
139 public string FormatDescription
141 get { return formatDescription; }
142 set { formatDescription = value; }
147 get { return formatID; }
148 set { formatID = value; }
152 public string MimeType
154 get { return mimeType; }
155 set { mimeType = value; }
159 [CLSCompliant(false)]
160 public byte[][] SignatureMasks
162 get { return signatureMasks; }
163 set { signatureMasks = value; }
166 [CLSCompliant(false)]
167 public byte[][] SignaturePatterns
169 get { return signaturePatterns; }
170 set { signaturePatterns = value; }
175 get { return version; }
176 set { version = value; }