MoveTo、LineTo,MFC中都可以用
==================
Graphics::DrawLine(Pen* pen, Point& pt1, Point& pt2)
The DrawLine method draws a line that connects two points.
Status DrawLine(
const Pen* pen,
const Point& pt1,
const Point& pt2
);
Parameters
pen
[in] Pointer to a pen that is used to draw the line.
pt1
[in] Reference to a Point object that specifies the start of the line.
pt2
[in] Reference to a Point object that specifies the end of the line.
Return Values
If the method succeeds, it returns Ok, which is an element of the Status enumeration.
If the method fails, it returns one of the other elements of the Status enumeration.
Example Code [C++]
The following example draws a line.
// Create two Point objects that define the line.
Point point1(100, 100);
Point point2(500, 100);
// Draw the line.
graphics.DrawLine(&blackPen, point1, point2);
}
Requirements
Windows NT/2000/XP: Included in Windows XP and Windows .NET Server. Redistributable: Requires GDI+ on Windows NT 4.0 SP6; Windows 2000; and Windows 98/Me.
Header: Declared in Gdiplusgraphics.h; include Gdiplus.h.