Declare Function LineTo Lib "gdi32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
.ForeColor
property. After the line is drawn, the endpoint specified is the new current point. This command is similar to Visual Basic's intrinsic Line method. Keep in mind that, because of the technique used by Windows to draw lines, the pixel that is the specified endpoint itself is not colored and is not considered part of the line. Don't ask me why this is done, but it also happens with VB's Line method. You can safely ignore the value returned.hdc | The device context of the graphical object to draw on. |
x | The x coordinate of the endpoint to draw to. |
y | The y coordinate of the endpoint to draw to. |
'Draw a red line from (0, 40) to (100, 50) on Form1
Dim r As POINTAPI 'for MoveToEx function
Form1.ForeColor = RGB(255, 0, 0) 'red
x = MoveToEx(Form1.hdc, 0, 40, r) 'set the current point to (0, 40)
x = LineTo(Form1.hdc, 100, 50) 'draw from (0, 40) to (100, 50)
Paul Kuliniewicz
E-mail: Borg953@aol.com
All material presented on these pages is Copyright © Paul Kuliniewicz, except for other copyrighted material.
http://members.aol.com/Borg953/api/l.html