How can I set coordinates of a line to new ones by code without deleting/adding new line?
Thanks for any support!
Giongcaysua
Page 1 of 1
Set coordinates of a line by code
#2
Posted 11 December 2007 - 06:00 PM
Here it is a VB6 example:
Option Explicit Dim LineHandle As Long Dim dx As Single Dim dy As Single Private Sub Command1_Click() Dim h() As Long, iType() As AvaxItemType Dim vProp() As Variant, vData() As Variant Dim xyz() As Single ReDim h(1) As Long h(1) = LineHandle If cAvax1.GetProperties(h(), iType(), vProp(), vData()) = True Then If iType(1) = Line_i Then xyz() = vData(1) xyz(1) = xyz(1) + dx 'x1 xyz(2) = xyz(2) + dy 'y1 xyz(4) = xyz(4) + dx 'x2 xyz(5) = xyz(5) + dy 'y2 vData(1) = xyz() Call cAvax1.SetProperties(h(), iType(), vProp(), vData()) LineHandle = cAvax1.LastHandle End If End If End Sub Private Sub Form_Load() Command1.Caption = "Move the line" dx = 1 dy = 1 Call cAvax1.StartAvax LineHandle = cAvax1.Add_Line(0, 0, 0, 10, 10, 0) End Sub Private Sub Form_Unload(Cancel As Integer) Call cAvax1.EndAvax End Sub
Athanasios Gardos
Avax-Software.com
Avax-Software.com
Page 1 of 1
Sign In
Register
Help
Add Reply
MultiQuote