示例#1
0
 public void DrawRect(GDIPen pen, int left, int top, int width, int height)
 {
     DrawLine(pen, new Point(left, top), new Point(left + width, top));
     DrawLine(pen, new Point(left, top + height), new Point(left + width, top + height));
     DrawLine(pen, new Point(left, top), new Point(left, top + height));
     DrawLine(pen, new Point(left + width, top), new Point(left + width, top + height + 1));
 }
示例#2
0
        public void DrawRect(Color color, int left, int top, int width, int height)
        {
            var p = new GDIPen(color, 1);

            DrawRect(p, left, top, width, height);
            p.Dispose();
        }
示例#3
0
        public void DrawLine(Color color, Point p1, Point p2)
        {
            var p = new GDIPen(color, 1);

            DrawLine(p, p1, p2);
            p.Dispose();
        }
示例#4
0
        public void DrawLine(GDIPen pen, Point p1, Point p2)
        {
            IntPtr   oldpen = NativeMethods.SelectObject(mhDC, pen.hPen);
            APIPoint gp;

            gp.x = 0;
            gp.y = 0;
            NativeMethods.MoveToEx(mhDC, p1.X, p1.Y, ref gp);
            NativeMethods.LineTo(mhDC, p2.X, p2.Y);
            NativeMethods.SelectObject(mhDC, oldpen);
        }
示例#5
0
 public void DrawRect(GDIPen pen, int left, int top, int width, int height)
 {
     DrawLine(pen, new Point(left, top), new Point(left + width, top));
     DrawLine(pen, new Point(left, top + height), new Point(left + width, top + height));
     DrawLine(pen, new Point(left, top), new Point(left, top + height));
     DrawLine(pen, new Point(left + width, top), new Point(left + width, top + height + 1));
 }
示例#6
0
 public void DrawRect(Color color, int left, int top, int width, int height)
 {
     var p = new GDIPen(color, 1);
     DrawRect(p, left, top, width, height);
     p.Dispose();
 }
示例#7
0
 public void DrawLine(Color color, Point p1, Point p2)
 {
     var p = new GDIPen(color, 1);
     DrawLine(p, p1, p2);
     p.Dispose();
 }
示例#8
0
 public void DrawLine(GDIPen pen, Point p1, Point p2)
 {
     IntPtr oldpen = NativeMethods.SelectObject(mhDC, pen.hPen);
     APIPoint gp;
     gp.x = 0;
     gp.y = 0;
     NativeMethods.MoveToEx(mhDC, p1.X, p1.Y, ref gp);
     NativeMethods.LineTo(mhDC, p2.X, p2.Y);
     NativeMethods.SelectObject(mhDC, oldpen);
 }