我是在wince下做的,没有ControlPaint.DrawReversibleLine 这个属性,我现在这样写的 struct POINTAPI { public int x; public int y; } [DllImport("coredll.dll")] private static extern bool LineTo(IntPtr hdc, IntPtr x, IntPtr y); public void LineTo(int x, int y) { LineTo(new IntPtr(hDc), new IntPtr(x), new IntPtr(y)); } public void DrawLine(int x1, int y1, int x2, int y2) {
POINTAPI lpOld = new POINTAPI(); MoveToEx(new IntPtr(hDc), new IntPtr(x1), new IntPtr(y1), ref lpOld); LineTo(new IntPtr(hDc), new IntPtr(x2), new IntPtr(y2)); } 其他的不会定义了
???
struct POINTAPI
{
public int x;
public int y;
}
[DllImport("coredll.dll")]
private static extern bool LineTo(IntPtr hdc, IntPtr x, IntPtr y);
public void LineTo(int x, int y)
{
LineTo(new IntPtr(hDc), new IntPtr(x), new IntPtr(y));
}
public void DrawLine(int x1, int y1, int x2, int y2)
{
POINTAPI lpOld = new POINTAPI();
MoveToEx(new IntPtr(hDc), new IntPtr(x1), new IntPtr(y1), ref lpOld);
LineTo(new IntPtr(hDc), new IntPtr(x2), new IntPtr(y2));
}
其他的不会定义了