Back to Home
Visual Graph Home
TriSun Software Inc. Home

Visual Graph Site Menu
Home
What is Visual Graph?
Screenshots
50 Technical Features
Getting Started
Abundant Graphic Libraries
File Format
FAQ
Online Demo (IE Only)
Common Applications
Visual Graph Getting Started
Use VG Component in Delphi 6
Use VG Component in VB6
Use Graphic Library
Change Element's Shape
Customize Property
Make Graphic Button
Get the Selected Elements
Dynamically Create Graph
Movable Label
Link Point
Access Properties
Use Line Vertexes
Call Windows API Functions
Call Visual Graph Functions
Callback Control Event in Script
Drag Graph in Run Mode
Detail Report
Make and Use Dialog Box

Visual Graph Getting Started - Use Line Vertexes

Now we make a sinusoid by a line and its vertexes.

Please follow these steps to make it.

1. Create a new file in Visual Graph IDE.

2. Draw a line and rect (basic elements in library group) in this document, right-click the rectangle to execute Add text command, and the paste the following text to rectangle:

Line1.PointCount=121
i=0
while i <= 120
Line1.X[i]=100+2*i
Line1.Y[i]=100+50*sin(i*3.1416/60)
i=i+1
wend
Line1.Refresh()


3. Click Program -> Command line menu item, input Execute (rect1.text) in the opened window and press <Enter>, the line will change to a sinusoid, like this:

Use Line Vertexes 1

4. Change rect1.text as below:

Line1.PointCount = 122
pi = 3.14159265359
i = 0
while i <= 120
Line1.X[i] = 100 + 50 * cos( i / 60 * pi )
Line1.Y[i] = 100 - 50 * sin( i / 60 * pi )
Line1.Bytes[i] = 6
Line1.X[i+1] = 100 + 60 * cos( i / 60 * pi )
Line1.Y[i+1] = 100 - 60 * sin( i / 60 * pi )
Line1.Bytes[i+1] = 2
i = i + 2
wend


input Execute (rect1.text) in the Command line window and press <Enter> again, the line will change as below:

Use Line Vertexes 2


Sitemap | Legal Notices | Privacy Policy | Contact Us | About Us
Copyright© 2001-2024 TriSun Software Inc. All rights reserved.