Declare Function MoveToEx Lib "gdi32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
MoveToEx sets the current point of a device. The current point is the starting point from which all graphics APIs ending with "To" (such as LineTo) begin drawing from. Other languages call this point the last point referenced. This function also puts the former current point into the variable passed as lpPoint. The function returns 0 if an error occured, or a non-zero value if successful.
Example:
' Draw a line from (0,0) to (100,100) in Form1
Dim old As POINTAPI
x = MoveToEx(Form1.hdc, 0, 0, old) ' set (0,0) as current point
x = LineTo(Form1.hdc, 100, 100) ' draws from current point to (100,100)
Category: Graphics
Back to the index.