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 ();
\r
73 newInfo [i] = new ImageCodecInfo ();
74 newInfo [i].clsid = codec.clsid;
75 newInfo [i].formatID = codec.formatID;
76 newInfo [i].codecName = codec.codecName;
77 newInfo [i].dllName = codec.dllName;
78 newInfo [i].flags = codec.flags;
79 newInfo [i].filenameExtension = codec.filenameExtension;
80 newInfo [i].formatDescription = codec.formatDescription;
81 newInfo [i].mimeType = codec.mimeType;
82 newInfo [i].signatureMasks = codec.signatureMasks;
83 newInfo [i].signaturePatterns = codec.signaturePatterns;
84 newInfo [i++].version = codec.version;
89 internal ImageCodecInfo () {
92 public static ImageCodecInfo[] GetImageEncoders ()
94 Hashtable oldInfo = ImageCodec.Encoders;
95 ImageCodecInfo [] newInfo = new ImageCodecInfo [oldInfo.Count];
97 foreach (ImageCodecInfo codec in oldInfo.Values) {
98 //newInfo [i++] = (ImageCodecInfo) codec.MemberwiseClone ();
99 newInfo [i] = new ImageCodecInfo ();
100 newInfo [i].clsid = codec.clsid;
101 newInfo [i].formatID = codec.formatID;
102 newInfo [i].codecName = codec.codecName;
103 newInfo [i].dllName = codec.dllName;
104 newInfo [i].flags = codec.flags;
105 newInfo [i].filenameExtension = codec.filenameExtension;
106 newInfo [i].formatDescription = codec.formatDescription;
107 newInfo [i].mimeType = codec.mimeType;
108 newInfo [i].signatureMasks = codec.signatureMasks;
109 newInfo [i].signaturePatterns = codec.signaturePatterns;
110 newInfo [i++].version = codec.version;
119 get { return clsid; }
120 set { clsid = value; }
124 public string CodecName
126 get { return codecName; }
127 set { codecName = value; }
131 public string DllName
133 get { return dllName; }
134 set { dllName = value; }
138 public string FilenameExtension
140 get { return filenameExtension; }
141 set { filenameExtension = value; }
145 public ImageCodecFlags Flags
147 get { return flags; }
148 set { flags = value; }
151 public string FormatDescription
153 get { return formatDescription; }
154 set { formatDescription = value; }
159 get { return formatID; }
160 set { formatID = value; }
164 public string MimeType
166 get { return mimeType; }
167 set { mimeType = value; }
171 [CLSCompliant(false)]
172 public byte[][] SignatureMasks
174 get { return signatureMasks; }
175 set { signatureMasks = value; }
178 [CLSCompliant(false)]
179 public byte[][] SignaturePatterns
181 get { return signaturePatterns; }
182 set { signaturePatterns = value; }
187 get { return version; }
188 set { version = value; }