Hi Gardos,
What I am attempting (and failing) to do seems simple, but I cannot figure it out.
I have an Avax drawing window with a width of 2500. I want to change the width to 5000, and move objects to their correct locations.
For example, I have a horizontal line that draws from the left edge of the drawing area to the middle (1250) originally. I want this line to now draw from the left edge to the new middle (2500).
I have tried various commands to do this, but have not gotten consistent behaviour (likely because of my code). I've attached before and after screen shots of my drawing area.
Any assistance would be appreciated.
Regards,
Bill Hojecki
Page 1 of 1
Resizing Drawing Area
#3
Posted 06 November 2008 - 04:55 PM
I didn't refine the image as much as I would normally, but you can see what I'm trying to do.
I want to keep the text size the same, but essentially re-center the lines we are drawing in code. You can ignore the buttons and text box. Those are for my own debugging of other code.
Thanks,
I want to keep the text size the same, but essentially re-center the lines we are drawing in code. You can ignore the buttons and text box. Those are for my own debugging of other code.
Thanks,
#5
Posted 10 November 2008 - 01:55 PM
You can do something like this:
Option Explicit
Dim hLine1 As Long
Dim hLine2 As Long
Private Sub Command1_Click()
cAvax1.Move 0, 0, cAvax1.Width * 1.2, cAvax1.Height * 1.2
Call RedrawAvax
End Sub
Private Sub RedrawAvax()
Dim h() As Long
Dim xMin As Single, yMin As Single, zMin As Single
Dim xMax As Single, yMax As Single, zMax As Single
Dim iType() As AvaxItemType, vProp() As Variant, vData() As Variant
Dim xyz() As Single
If cAvax1.GetBoundsAvax(xMin, yMin, zMin, xMax, yMax, zMax) = True Then
If cAvax1.GetHandlesByKey("Line1", h()) <> 0 Then
If cAvax1.GetProperties(h(), iType(), vProp(), vData()) = True Then
If iType(1) = Line_i Then
xyz() = vData(1)
xyz(1) = xMin
xyz(2) = yMin + (yMax - yMin) / 2
xyz(4) = xMax
xyz(5) = xyz(2)
vData(1) = xyz()
Call cAvax1.SetProperties(h(), iType(), vProp(), vData())
End If
End If
End If
If cAvax1.GetHandlesByKey("Line2", h()) <> 0 Then
If cAvax1.GetProperties(h(), iType(), vProp(), vData()) = True Then
If iType(1) = Line_i Then
xyz() = vData(1)
xyz(1) = xMin + (xMax - xMin) / 2
xyz(2) = yMin
xyz(4) = xyz(1)
xyz(5) = yMax
vData(1) = xyz()
Call cAvax1.SetProperties(h(), iType(), vProp(), vData())
End If
End If
End If
End If
End Sub
Private Sub Form_Load()
Command1.Caption = "Resize avax * 1.2"
Call cAvax1.StartAvax
hLine1 = cAvax1.Add_Line(0, 0, 0, 10, 10, 0)
Call cAvax1.SetHandleKey(hLine1, "Line1")
hLine2 = cAvax1.Add_Line(0, 10, 0, 10, 0, 0)
Call cAvax1.SetHandleKey(hLine2, "Line2")
Call RedrawAvax
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