Merge pull request #1304 from slluis/mac-proxy-autoconfig
[mono.git] / mcs / class / System.Drawing / System.Drawing.Imaging / BitmapData.cs
1 //
2 // System.Drawing.Imaging.BitmapData.cs
3 //
4 // Author:
5 //   Miguel de Icaza (miguel@ximian.com)
6 //   Vladimir Vukicevic (vladimir@pobox.com)
7 //
8 // (C) 2002 Ximian, Inc.  http://www.ximian.com
9 // Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System.Runtime.InteropServices;
32
33 namespace System.Drawing.Imaging
34 {
35         // MUST BE KEPT IN SYNC WITH gdip.h in libgdiplus!
36         // The first 6 fields MUST also match MS definition
37         [StructLayout(LayoutKind.Sequential)]
38         public sealed class BitmapData {
39                 private int             width;
40                 private int             height;
41                 private int             stride;
42                 private PixelFormat     pixel_format; // int
43                 private IntPtr          scan0;
44                 private int             reserved;
45 #pragma warning disable 169
46                 // *** Warning ***      don't depend on those fields in managed
47                 //                      code as they won't exists when using MS
48                 //                      GDI+
49                 private IntPtr  palette;
50                 private int             property_count;
51                 private IntPtr  property;
52                 private float           dpi_horz;
53                 private float           dpi_vert;
54                 private int             image_flags;
55                 private int             left;
56                 private int             top;
57                 private int             x;
58                 private int             y;
59                 private int             transparent;
60                 // *** Warning ***
61 #pragma warning restore 169
62
63                 public int Height {
64                         get {
65                                 return height;
66                         }
67
68                         set {
69                                 height = value;
70                         }
71                 }
72
73                 public int Width {
74                         get {
75                                 return width;
76                         }
77
78                         set {
79                                 width = value;
80                         }
81                 }
82
83                 public PixelFormat PixelFormat {
84                         get {
85                                 
86                                 return pixel_format;
87                         }
88
89                         set {
90                                 pixel_format = value;
91                         }
92                 }
93
94                 public int Reserved {
95                         get {
96                                 return reserved;
97                         }
98
99                         set {
100                                 reserved = value;
101                         }
102                 }
103
104                 public IntPtr Scan0 {
105                         get {
106                                 return scan0;
107                         }
108
109                         set {
110                                 scan0 = value;
111                         }
112                 }
113
114                 public int Stride {
115                         get {
116                                 return stride;
117                         }
118
119                         set {
120                                 stride = value;
121                         }
122                 }
123         }
124 }