Results 1 to 6 of 6

Thread: How do I code pictureboxes move in circlar form round a form in vb.net

  1. #1
    Nonasoft is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    May 2007
    Posts
    16
    Reputation
    76

    How do I code pictureboxes move in circlar form round a form in vb.net

    Hello room, I need to design a program that will have some images displayed in pictureboxes. I need to make those picture boxes rotate like in encarta 2004 or any other form possible.

    Plz I need somebody that can me give crew or code on hw I can do.

  2. #2
    Wiz Kid is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Aug 2007
    Location
    Atlanta, GA, USA
    Posts
    21
    Reputation
    105
    Hi. Think of it logically. You must rotate the Image in the picture box x degrees. Then, you will need to rotate the image x + some more degrees.

    Strap this on to a Timer.

    Code:
    Me.PictureBox.Image.RotateFlip(RotateFlipType)
    If you just want to Rotate your image in a circle, you will most likely use Rotate90FlipNone.

    Sure, that will RotateFlip your image but it won't update.

    Thus, you will need to call Me.Refresh() after RotateFlipping your image.
    If I helped you, please give me rep!

    Thanks.

    -Wiz Kid

  3. #3
    Nonasoft is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    May 2007
    Posts
    16
    Reputation
    76
    Am not saying rotating the in mage inside the picturebox, am taking about rotaing the picture box location itself ranging from one location to another. The way the clock hand turns that is how I want the picturebox rotate on various location circularly on the form like encarta 2004.

  4. #4
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,197
    Reputation
    2368
    See the attached sample, I haven't seen Encarta but added 6 Pictureboxes to a form in a circular fashion and used GraphicsPath to get the point references of this circle, then used BackgroundWorker to "animate" them by setting new locations not too fast. I just wrote the name of the Picturebox so it is easy to see which is which when they move around, didn't load any images. This should give you an idea of what you can work with.
    Attached Files Attached Files

  5. #5
    Nonasoft is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    May 2007
    Posts
    16
    Reputation
    76
    John H thanks you so much. Your post solved my problem completely, the rest work is mine since you have made foundation for. I love you!

    Remain blessed!

  6. #6
    Nonasoft is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    May 2007
    Posts
    16
    Reputation
    76
    John H your code solved my problem remaining that it rotates like clock. It ticks, can u help give me crew on how to make rotate like tyre of a car or electric fan not like wall clock just like encarta 2004

    Plz ur help is of immense importance.

    God bless

Bookmarks

Posting Permissions

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