Results 1 to 7 of 7

Thread: [RESOLVED] path for pictureboxes

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    142

    Resolved [RESOLVED] path for pictureboxes

    hello, what is the easiest way to make a picturebox follow a path determined by waypoints? without using like 100 if statements and timers. Thanks

  2. #2
    Frenzied Member MattP's Avatar
    Join Date
    Dec 2008
    Location
    WY
    Posts
    1,227

    Re: path for pictureboxes

    I'd really recommend WPF if you're going to be doing animations like this.

    Get a copy of Expression Blend (60 day free trial).

    Animating objects
    This pattern in common to all great programmers I know: they're not experts in something as much as experts in becoming experts in something.

    The best programming advice I ever got was to spend my entire career becoming educable. And I suggest you do the same.

  3. #3
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: path for pictureboxes

    How do you store your waypoints? using an array? Using a loop or a Timer make the pBox travel the Array by setting Left to X and Top to Y. Or can use a GraphicsPath, but i'm not sure there will be any difference in this case.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    142

    Re: path for pictureboxes

    i just use labels as waypoints, I don't know if I can make that work

  5. #5
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: path for pictureboxes

    Could you attach your project?

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    142

    Re: path for pictureboxes

    Its attached, but a really simple version of it, due upload limit
    Attached Files Attached Files

  7. #7
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: path for pictureboxes

    Ok, this requires some aritmethic calculations for Distance, X and Y. As it is now the Waypoints are taken from Label's names, you can change Text on them but I used their names to define relations using the Controls Collection.

    Note: You forgot to attach some images so I used another image for the PictureBox. The Project is attached.
    Attached Files Attached Files
    Last edited by jcis; May 9th, 2012 at 02:06 AM.

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