2 // System.Drawing.Imaging.MetaHeader.cs
5 // Everaldo Canuto (everaldo.canuto@bol.com.br)
6 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
7 // Dennis Hayes (dennish@raytek.com)
8 // Sebastien Pouliot <sebastien@ximian.com>
10 // (C) 2002 Ximian, Inc. http://www.ximian.com
11 // Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com)
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System.Runtime.InteropServices;
35 namespace System.Drawing.Imaging {
37 [StructLayout (LayoutKind.Sequential, Pack=2)]
38 internal struct WmfMetaHeader {
39 // field order match: http://wvware.sourceforge.net/caolan/ora-wmf.html
40 // for WMFHEAD structure
41 public short file_type;
42 public short header_size;
45 public short num_of_objects;
46 public int max_record_size;
47 public short num_of_params;
50 [StructLayout (LayoutKind.Sequential)]
51 public sealed class MetaHeader {
53 private WmfMetaHeader wmf;
59 internal MetaHeader (WmfMetaHeader header)
61 wmf.file_type = header.file_type;
62 wmf.header_size = header.header_size;
63 wmf.version = header.version;
64 wmf.file_size = header.file_size;
65 wmf.num_of_objects = header.num_of_objects;
66 wmf.max_record_size = header.max_record_size;
67 wmf.num_of_params = header.num_of_params;
71 public short HeaderSize {
72 get { return wmf.header_size; }
73 set { wmf.header_size = value; }
76 public int MaxRecord {
77 get { return wmf.max_record_size; }
78 set { wmf.max_record_size = value; }
81 public short NoObjects {
82 get { return wmf.num_of_objects; }
83 set { wmf.num_of_objects = value; }
86 public short NoParameters {
87 get { return wmf.num_of_params; }
88 set { wmf.num_of_params = value; }
92 get { return wmf.file_size; }
93 set { wmf.file_size = value; }
97 get { return wmf.file_type; }
98 set { wmf.file_type = value; }
101 public short Version {
102 get { return wmf.version; }
103 set { wmf.version = value; }