在GDI+中没有疑惑画法,调用API实现异或画线,现在的思路是重新封装API的画图类,写个类似Graphics的类,请各位给点思路,不胜感激

解决方案 »

  1.   

     ControlPaint.DrawReversibleLine 
    ???
      

  2.   

    我是在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));
            }
    其他的不会定义了
      

  3.   

    http://www.csharpwin.com/csharpspace/2633.shtml
      

  4.   

    谢谢XiaNao16888,我已经用gdi+实现了画图的功能,因为我的程序是在wince环境下做的,gdi+有很多不支持的功能,现在想自己写一个用API封装的类实现gdi+不能实现的功能,比如说画圆角矩形,异或线。能否给与指导?