也可用WinAPI:
DECLARE LONG GetDC IN User32 LONG
DECLARE LONG ReleaseDC IN User32 LONG, LONG
DECLARE LONG CreatePen IN Gdi32 LONG, LONG, LONG
DECLARE LONG SelectObject IN Gdi32 LONG, LONG
DECLARE LONG MoveToEx IN Gdi32 LONG, LONG, LONG, LONG
DECLARE LONG LineTo IN Gdi32 LONG, LONG, LONG
DECLARE LONG DeleteObject IN Gdi32 LONG
#DEFINE PS_SOLID 0 && 实线
CLEAR
hDC = GetDC(_SCREEN.hWnd)
hPen = CreatePen(PS_SOLID, 1, 0x0000FF) && 创建新画笔。样式, 线宽,颜色
hPenOld = SelectObject(hdc, hPen) && 设置新画笔
_DrawLine(hDC, 10, 5, 100, 50)
SelectObject(hdc, hPenOld) && 恢复旧画笔
DeleteObject(hPen) && 清除画笔
ReleaseDC(_SCREEN.hWnd, hDC)
CLEAR DLLS
FUNCTION _DrawLine(hDC, x1, y1, x2, y2)
MoveToEx(hDC, x1, y1, 0) && 线起点(x, y)
LineTo(hDC, x2, y2) && 线终点(x, y)
ENDFUNC