Results 1 to 5 of 5

Thread: Help with tables

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2021
    Posts
    2

    Question Help with tables

    So I'm making the mouse move to specific coordinates to draw an image for me. It takes alot of time to type all off the coordinates in like this:
    moveCursor(140, 204)
    moveCursor(123, 193)
    moveCursor(99, 189)
    moveCursor(74, 196)
    moveCursor(58, 213)
    moveCursor(49, 237)
    moveCursor(52, 261)
    moveCursor(65, 279)
    moveCursor(86, 292)
    moveCursor(113, 295)
    moveCursor(135, 282)
    So I thought that I could make a table and it would do this automatic?

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,467

    Re: Help with tables

    Supposing you're using VB.Net and GDI+, you can create a Point array and use the Graphics objects' .DrawLines method...

    Dim points() As Point = New Point(){New Point(140, 204), New Point(123, 193), ... etc.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2021
    Posts
    2

    Re: Help with tables

    For exampel if I have alot of coordinates to type in can't I just paste them in a table and a loop runs through all of the coordinates so I don't have to type them all in like this:
    moveCursor(140, 204)
    moveCursor(123, 193)
    moveCursor(99, 189)

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,467

    Re: Help with tables

    Which version of VB are you using? Can you post your actual drawing code?, because none of what you have posted makes any sense in VB.Net

  5. #5
    Fanatic Member Delaney's Avatar
    Join Date
    Nov 2019
    Location
    Paris, France
    Posts
    845

    Re: Help with tables

    put all your coordinates in the correct order in a text file, read that text file into a list(of point) and then create a loop :

    Code:
    for each pt as point in list_of_points
      moveCursor(pt.X, pt.Y)
    next
    if you want only part of the list, you can play with a "for i" loop and the index in the list

    Code:
    for i= 5 to 10
     moveCursor( list_of_points(i).X,list_of_points(i).Y)
    next
    The best friend of any programmer is a search engine
    "Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
    “They did not know it was impossible so they did it” (Mark Twain)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width