AVAX-software.com Forums: Line scaling and various problems - AVAX-software.com Forums

Jump to content

Page 1 of 1

Line scaling and various problems

#1 User is offline   Hjeldin_ita Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 03-March 09

Posted 21 January 2010 - 05:28 PM

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!

#2 User is offline   elias Icon

  • Newbie
  • Icon
  • Group: Support
  • Posts: 45
  • Joined: 24-October 08
  • Gender:Male

Posted 23 January 2010 - 08:53 AM

Hi,

We will reply to you on Monday

#3 User is offline   elias Icon

  • Newbie
  • Icon
  • Group: Support
  • Posts: 45
  • Joined: 24-October 08
  • Gender:Male

Posted 25 January 2010 - 12:38 PM

Hi,

I can't understand the line scaling problem. Can you be for specific and send me an example project?

About the zoom issue you can set the zoom manually by using the avax methods
SetBoundsAvax, SetBoundsDrawing, SetBoundsZoom at the same time.

#4 User is offline   Hjeldin_ita Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 03-March 09

Posted 25 January 2010 - 05:32 PM

Hi,
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.

#5 User is offline   elias Icon

  • Newbie
  • Icon
  • Group: Support
  • Posts: 45
  • Joined: 24-October 08
  • Gender:Male

Posted 26 January 2010 - 12:14 PM

OK, we will try to resolve this.

#6 User is offline   elias Icon

  • Newbie
  • Icon
  • Group: Support
  • Posts: 45
  • Joined: 24-October 08
  • Gender:Male

Posted 02 February 2010 - 02:06 PM

We have found a solution. There will be a new version next week to download.
I will then write an example code for you to test.

#7 User is offline   elias Icon

  • Newbie
  • Icon
  • Group: Support
  • Posts: 45
  • Joined: 24-October 08
  • Gender:Male

Posted 16 February 2010 - 07:26 AM

The new version is ready to download. Use the
cAvax1.SetAvaxProperty(AvaxProp.ScaleSensitivity_p, Value)
code to infect the scaling step. If Value > 1 the scaling step decreases. If Value < 1 the scaling step increases.

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users