Hi,
i've got a problem while scaling a line.
Is there a way to set the scale factor to use with Scale_c? Using a 1:100 scale, the movement from a point to the closer, enlarges the line with a 100 factor, so if i have a line of 10 length, the movement to the next point enlarges the line to 10000.
We also have a problem with the zoom. How can i leave a blank space between the last visible object in the drawing and the margin of the cAvax? Furthermore if i use the Show all command, the activex doesn't allow me to zoom out more.
Thank you!
Page 1 of 1
Line scaling and various problems
#4
Posted 25 January 2010 - 05:32 PM
Hi,
the code is the following:
For example, if you click the button and move the mouse of 2 px, the line grows too much. Is there a way to set the scaling factor?
DimScale seems not working.
the code is the following:
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AxcAvax1.StartAvax()
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.xMin_p, -1000)
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.yMin_p, -1000)
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.xMax_p, 1000)
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.yMax_p, 1000)
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.GridOn_p, True)
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.GridStepX_p, 100)
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.GridStepY_p, 100)
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.ScaleEqual_p, 200)
Call AxcAvax1.SetAvaxProperty(Avax.AvaxProp.DimScale_p, 1)
Dim xMin As Single
Dim yMin As Single
Dim zMin As Single
Dim xMax As Single
Dim yMax As Single
Dim zMax As Single
xMin = -1000
yMin = -1000
zMin = -1000
xMax = 1000
yMax = 1000
zMax = 1000
If AxcAvax1.SetBoundsAvax(xMin, yMin, zMin, xMax, yMax, zMax) = True Then
AxcAvax1.Command = Avax.AvaxCommand.All_c
End If
Call AxcAvax1.Add_Line(0, 0, 0, 1000, 0, 0)
ctlRulerOR.Visible = True
ctlRulerVER.Visible = True
ctlRulerOR.Orientation = AvaxRuler.AvaxRulerOrientation.Orientation_X_Up
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
AxcAvax1.Command = Avax.AvaxCommand.Scale_c
End Sub
Public Sub RulersRefresh()
Dim fX1 As Single
Dim fY1 As Single
Dim lxPix As Long
Dim lyPix As Long
On Error GoTo ErrHandler
If AxcAvax1.CurrentXY(fX1, fY1) = True Then
If AxcAvax1.SingleToLong(fX1, fY1, lxPix, lyPix) = True Then
Call ctlRulerOR.DrawRulerLine(lxPix, lyPix)
Call ctlRulerVER.DrawRulerLine(lxPix, lyPix)
Else
Call ctlRulerOR.DeleteRulerLine()
Call ctlRulerVER.DeleteRulerLine()
End If
Else
Call ctlRulerOR.DeleteRulerLine()
Call ctlRulerVER.DeleteRulerLine()
End If
ExitProcedure:
Exit Sub
ErrHandler:
Resume ExitProcedure
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
RulersRefresh()
End Sub
Private Sub AxcAvax1_ZoomChange(ByVal sender As Object, ByVal e As AxAvax.__cAvax_ZoomChangeEvent) Handles AxcAvax1.ZoomChange
Dim fXStep As Single
Dim fYStep As Single
Dim fXYStep As Single
On Error GoTo ErrHandler
fXStep = ctlRulerOR.GetAutoStep(e.xMin, e.yMin, e.xMax, e.yMax)
fYStep = ctlRulerVER.GetAutoStep(e.xMin, e.yMin, e.xMax, e.yMax)
If fXStep > fYStep Then fXYStep = fXStep Else fXYStep = fYStep
Call ctlRulerOR.SetRulerDimensions(e.xMin, e.yMin, e.xMax, e.yMax, fXYStep)
Call ctlRulerVER.SetRulerDimensions(e.xMin, e.yMin, e.xMax, e.yMax, fXYStep)
ExitProcedure:
Exit Sub
ErrHandler:
Resume ExitProcedure
End Sub
End Class
For example, if you click the button and move the mouse of 2 px, the line grows too much. Is there a way to set the scaling factor?
DimScale seems not working.
Page 1 of 1
Sign In
Register
Help
Add Reply
MultiQuote