如果是win32 application的话,可以用api函数实现如:
MoveTo(hdc,point1.x,point1.y);
LineTo(hdc,point2.x,point2.y);
见MSDN,还有新函数
BOOL MoveToEx(
HDC hdc, // handle to device context
int X, // x-coordinate of new current position
int Y, // y-coordinate of new current position
LPPOINT lpPoint // pointer to old current position
);
也可以使用。