 |
gfak25 Level: Trainee
 Registered: 12-04-2004 Posts: 3
|
Draw a soft line
I want to draw a line (very straight , soft) with vb6 like other programs
like flash,word
|
|
14-04-2005 at 04:24 PM |
|
|
misterxed Level: VB Lord

 Registered: 12-06-2005 Posts: 151
|
Re: Draw a soft line
Hi there,
First of all you must have hdc of the contxt you want to draw at.its actually a drawing context handle.Then if you have the drawing handle you can draw anything on the context.for drawing smooth lines you can use the API MoveTo and LineTo.
But for drawing lines of any specific width and type you must have to make a pen and select it in the context.
For example:
'Module code:
Public Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Public Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, lpPoint As POINTAPI) As Long
Public Type POINTAPI
X As Long
Y As Long
End Type
Public point As POINTAPI
' This code will draw a line in the hdc from 10,10 to 100,100
Call MoveToEx(hdc,10,10,point)
Call LineTo(hdc,100,100)
|
Regards,
mister xed...
____________________________
lOsT...
|
|
27-07-2005 at 03:33 PM |
|
|
|
|
 |
 |