-
How Can I Draw A Line With A Button
Private Sub Command1_Click()
Dim n, j, i, k, g, b As Integer
Dim D As Single
Dim v(), dok(), Shmeio(), X(), Y() As Variant
Dim GAB As Double, GAC As Double
Dim DXA As Double, DYA As Double
Dim DXB As Double, DYB As Double
Dim pi As Double
pi = 4 * Atn(1)
Form1.Cls
Open "c:\leon\coords.txt" For Input As 1
b = 0
While Not EOF(1)
b = b + 1
Line Input #1, g
Wend
n = b
Print n
Close #1
ReDim v(n - 2), dok(n - 2), Shmeio(n), X(n), Y(n)
Open "c:\leon\coords.txt" For Input As 2
j = 0
While Not EOF(2)
j = j + 1
Input #2, Shmeio(j), X(j), Y(j)
Wend
Close #2
For i = 1 To n - 2
DXB = X(i + 2) - X(i)
DYB = Y(i + 2) - Y(i)
GAC = Atn(DXB / DYB)
DXA = X(i + 1) - X(i)
DYA = Y(i + 1) - Y(i)
GAB = Atn(DXA / DYA)
v(i) = Abs(GAC - GAB)
Print v(i)
Next i
D = InputBox("Ποια θα είναι η οριακή γωνία; (σε Grad) ")
Print D
Open "c:\leon\coords_telikes.txt" For Output As 3
Print #3, Shmeio(1); X(1); Y(1)
For k = 1 To n - 2
If v(k) > D Then
Print k + 1
Print #3, Shmeio(k + 1); X(k + 1); Y(k + 1)
Else
Print "THE POINT "; k + 1; " REJECTED"
End If
Next k
Print n
Print #3, Shmeio(n); X(n); Y(n)
Close #3
End Sub
--------------------------------------------------------------------------
I want to make a button tha draws the line with points (X,Y) of the primary file coords.txt and at the same time draws the line with the remaining points (X,Y) of the new file coords_telikes.txt
Similar Threads
-
By junlo in forum VB Classic
Replies: 1
Last Post: 03-29-2007, 11:46 AM
-
By 2eXtreme in forum Java
Replies: 0
Last Post: 04-05-2006, 07:38 AM
-
By oblivionph in forum Java
Replies: 9
Last Post: 09-20-2005, 01:16 PM
-
Replies: 0
Last Post: 08-08-2005, 09:46 AM
-
By Ad van Klink in forum .NET
Replies: 1
Last Post: 09-01-2002, 08:52 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks