Rotating arrow

Discussion in 'Code Samples & Tips' started by Erel, May 11, 2007.

  1. Erel

    Erel Administrator Staff Member Licensed User

    This is an example of using the form's ForeLayer property with the Polygon method to create a rotating arrow.
    The position of each coordinate is calculated using this formula:
    New X = X * Cos(degree) - Y * Sin(degree)
    New Y = Y * Cos (degree) + X * Sin(degree)

    As we are using the forelayer there is no need to redraw the background.

    Attached Files:

  2. derez

    derez Expert Licensed User

    letter - number

    Hi Erel
    Thank you for this example - it was helpful for me.
    Took me a while to understand why when I type the code I get an error, and if I copy it from youe example - it runs.
    The problem is that "l" and "1" in the program look very similar (the name of the array is alX)
    see photo.

    Attached Files:

    • alx.JPG
      File size:
      10.6 KB
  3. Erel

    Erel Administrator Staff Member Licensed User

    I see your point.
    Next time it will be named list1 as it is more clear.