using System.Drawing; using System.Runtime.InteropServices; namespace Microsoft.Win32 { /// /// TRIVERTEX定义 /// public static partial class NativeMethods { /// /// 实现功能:The TRIVERTEX structure contains color information and position information. /// 调用方法:Win32结构体 /// . /// 创建人员:许崇雷 /// 创建日期:2013-11-25 /// 创建备注: /// . /// 修改人员: /// 修改日期: /// 修改备注: /// [StructLayout(LayoutKind.Sequential)] public struct TRIVERTEX { /// /// The x-coordinate, in logical units, of the upper-left corner of the rectangle. /// int x; /// /// The y-coordinate, in logical units, of the upper-left corner of the rectangle. /// int y; /// /// The color information at the point of x, y. /// ushort Red; /// /// The color information at the point of x, y. /// ushort Green; /// /// The color information at the point of x, y. /// ushort Blue; /// /// The color information at the point of x, y. /// ushort Alpha; /// /// 构造函数 /// /// 横坐标 /// 纵坐标 /// R /// G /// B /// A public TRIVERTEX(int x, int y, ushort red, ushort green, ushort blue, ushort alpha) { this.x = x; this.y = y; this.Red = red; this.Green = green; this.Blue = blue; this.Alpha = alpha; } /// /// 构造函数 /// /// 横坐标 /// 纵坐标 /// 颜色 public TRIVERTEX(int x, int y, Color color) { this.x = x; this.y = y; this.Red = color.R; this.Green = color.G; this.Blue = color.B; this.Alpha = color.A; } /// /// 构造函数 /// /// 坐标 /// 颜色 public TRIVERTEX(Point pt, Color color) { this.x = pt.X; this.y = pt.Y; this.Red = color.R; this.Green = color.G; this.Blue = color.B; this.Alpha = color.A; } } } }