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 (is this possible to retriev ...)Next Topic (How to Use RegQueryValueEx In VB) New Topic New Poll Post Reply
AndreaVB Forum : API : Graphics
Poster Message
gfak25
Level: Trainee

Registered: 12-04-2004
Posts: 3

icon Graphics

I want to draw a very soft line in vb6
where u want to draw a line inclined with 30 degree on the horizontal it is not be soft can help>

01-07-2005 at 05:34 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Graphics

Hi,
What do you mean by a "soft line", using Radians and pythag, it's quite easy to draw a line at any angle. There are loads of theories on it (especially when optimising graphics).
E.g.
Using SOHCAHTOA maths:
for Point (x,y)
Target point (i,y) at 30 units long, at 30 deg from vertical is:

dim rads as single

rads = 180 ' a radion is a 0.5*pi(? check with the other programmers)

dim degs as single
degs = rads / 6

dim h as single
h = 30

dim i as single, j as single

i = sin(degs)/h
j = sin(degs)*h

Hope this helps (my math is a bit rusty)
Kieron

PS. Search for "line drawing algorithms" in google for more

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

07-07-2005 at 01:36 AM
View Profile Send Email to User Show All Posts | Quote Reply
gfak25
Level: Trainee

Registered: 12-04-2004
Posts: 3
icon Re: Graphics

Thanks
I mean by soft that the line be smoothed
try to plot line in paintBrush program , Horizontal,vertical and inclined and note the diference between them .
I want a very simple algoritm or program .

[Edited by gfak25 on 07-07-2005 at 12:38 PM GMT]

07-07-2005 at 12:36 PM
View Profile Send Email to User Show All Posts | Quote Reply
humberto
Level: VB Lord

Registered: 13-01-2005
Posts: 246
icon Re: Graphics

Function PI() As Double
PI = 4 * Atn(1#)
End Function

07-07-2005 at 04:59 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : Graphics
Previous Topic (is this possible to retriev ...)Next Topic (How to Use RegQueryValueEx In VB) 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