TRIVERTEX.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System.Drawing;
  2. using System.Runtime.InteropServices;
  3. namespace Microsoft.Win32
  4. {
  5. /// <summary>
  6. /// TRIVERTEX定义
  7. /// </summary>
  8. public static partial class NativeMethods
  9. {
  10. /// <summary>
  11. /// <para>实现功能:The TRIVERTEX structure contains color information and position information.</para>
  12. /// <para>调用方法:Win32结构体</para>
  13. /// <para>.</para>
  14. /// <para>创建人员:许崇雷</para>
  15. /// <para>创建日期:2013-11-25</para>
  16. /// <para>创建备注:</para>
  17. /// <para>.</para>
  18. /// <para>修改人员:</para>
  19. /// <para>修改日期:</para>
  20. /// <para>修改备注:</para>
  21. /// </summary>
  22. [StructLayout(LayoutKind.Sequential)]
  23. public struct TRIVERTEX
  24. {
  25. /// <summary>
  26. /// The x-coordinate, in logical units, of the upper-left corner of the rectangle.
  27. /// </summary>
  28. int x;
  29. /// <summary>
  30. /// The y-coordinate, in logical units, of the upper-left corner of the rectangle.
  31. /// </summary>
  32. int y;
  33. /// <summary>
  34. /// The color information at the point of x, y.
  35. /// </summary>
  36. ushort Red;
  37. /// <summary>
  38. /// The color information at the point of x, y.
  39. /// </summary>
  40. ushort Green;
  41. /// <summary>
  42. /// The color information at the point of x, y.
  43. /// </summary>
  44. ushort Blue;
  45. /// <summary>
  46. /// The color information at the point of x, y.
  47. /// </summary>
  48. ushort Alpha;
  49. /// <summary>
  50. /// 构造函数
  51. /// </summary>
  52. /// <param name="x">横坐标</param>
  53. /// <param name="y">纵坐标</param>
  54. /// <param name="red">R</param>
  55. /// <param name="green">G</param>
  56. /// <param name="blue">B</param>
  57. /// <param name="alpha">A</param>
  58. public TRIVERTEX(int x, int y, ushort red, ushort green, ushort blue, ushort alpha)
  59. {
  60. this.x = x;
  61. this.y = y;
  62. this.Red = red;
  63. this.Green = green;
  64. this.Blue = blue;
  65. this.Alpha = alpha;
  66. }
  67. /// <summary>
  68. /// 构造函数
  69. /// </summary>
  70. /// <param name="x">横坐标</param>
  71. /// <param name="y">纵坐标</param>
  72. /// <param name="color">颜色</param>
  73. public TRIVERTEX(int x, int y, Color color)
  74. {
  75. this.x = x;
  76. this.y = y;
  77. this.Red = color.R;
  78. this.Green = color.G;
  79. this.Blue = color.B;
  80. this.Alpha = color.A;
  81. }
  82. /// <summary>
  83. /// 构造函数
  84. /// </summary>
  85. /// <param name="pt">坐标</param>
  86. /// <param name="color">颜色</param>
  87. public TRIVERTEX(Point pt, Color color)
  88. {
  89. this.x = pt.X;
  90. this.y = pt.Y;
  91. this.Red = color.R;
  92. this.Green = color.G;
  93. this.Blue = color.B;
  94. this.Alpha = color.A;
  95. }
  96. }
  97. }
  98. }