BitmapData.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. //
  2. // System.Drawing.Imaging.BitmapData.cs
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. // Vladimir Vukicevic ([email protected])
  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. using System.Runtime.InteropServices;
  31. namespace System.Drawing.Imaging
  32. {
  33. // MUST BE KEPT IN SYNC WITH gdip.h in libgdiplus!
  34. // The first 6 fields MUST also match MS definition
  35. #if TARGET_JVM
  36. [MonoTODO]
  37. #endif
  38. [StructLayout(LayoutKind.Sequential)]
  39. public sealed class BitmapData {
  40. private int width;
  41. private int height;
  42. private int stride;
  43. private PixelFormat pixel_format; // int
  44. private IntPtr scan0;
  45. private int reserved;
  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. public int Height {
  62. get {
  63. return height;
  64. }
  65. set {
  66. height = value;
  67. }
  68. }
  69. public int Width {
  70. get {
  71. return width;
  72. }
  73. set {
  74. width = value;
  75. }
  76. }
  77. public PixelFormat PixelFormat {
  78. get {
  79. return pixel_format;
  80. }
  81. set {
  82. pixel_format = value;
  83. }
  84. }
  85. public int Reserved {
  86. get {
  87. return reserved;
  88. }
  89. set {
  90. reserved = value;
  91. }
  92. }
  93. public IntPtr Scan0 {
  94. get {
  95. return scan0;
  96. }
  97. set {
  98. scan0 = value;
  99. }
  100. }
  101. public int Stride {
  102. get {
  103. return stride;
  104. }
  105. set {
  106. stride = value;
  107. }
  108. }
  109. }
  110. }