borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Path To Region Error)Next Topic (Launch VB via shell execute) New Topic New Poll Post Reply
AndreaVB Forum : API : Draw a soft line
Poster Message
gfak25
Level: Trainee

Registered: 12-04-2004
Posts: 3

icon 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
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Draw a soft line

hi gfak,
Using the standard VB Line control, u can't make a SOFT line... but i think u can make 2 lines, which would make it 3d type.. the actual line should b a bit bigger than the other line, and should b a single pixel above it.. that'd b a good approach i guess   Hope that helps...


____________________________
lOsT...

17-06-2005 at 12:10 PM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Draw a soft line

hi there,
I just found out the following website.. i thot this might b of ur interest...

http://www.efg2.com/Lab/Graphics/Jean-YvesQueinecBezierCurves.htm

bye

____________________________
lOsT...

13-07-2005 at 10:26 AM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : Draw a soft line
Previous Topic (Path To Region Error)Next Topic (Launch VB via shell execute) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder