Link to home
Start Free TrialLog in
Avatar of n-generation
n-generation

asked on

Rotating picture.

Currently I have four images of a frog facing four different directions.  Up, Down, Left, Right.  I want it to rotate.  (i.e. show each image) in order and you can see it rotate.  How do I get round doing this?
The frogs are in arrays.  Is ImgFrog(0) is Up, ImgFrog(1) is Right and go round clockwise etc.

Thanks!
Avatar of inthedark
inthedark
Flag of United Kingdom of Great Britain and Northern Ireland image

Do you mean like an animation.

The simple way is to use the micrrsoft freebie Microsoft Gif Animator. You can merge each picture into one GIF and set timing for each image.

Or using VB you can set a timer control to a have an interval value of say 500 (half a second). Increase to slow down, decrease to speed up or 0 to stop.


Sub Timer1_Timer()

Static lCurrentPicture as Long

imgFrog(lCurrentPicture).Visible = False
lCurrentPicture = lCurrentPicture + 1
if lCurrentPicture>3 Then
   lCurrentPicture=0
End If
imgFrog(lCurrentPicture).Visible = True

End Sub
Do you want 1 image to rotate on it's centre point ?
(http://www.vbcode.com/code/imgedit.zip )

or just show the images after each other
(then I guess you'll have to use a timer, that after fe a minute changes the image in the imagebox)
Avatar of sazhagianambi
sazhagianambi

Declare Variable i

Place One Timer.

Set The Interval as 1000
/*   Place The Following Code   */

Private Sub Timer1_Timer()
   i = i + 1
'   MsgBox i
   Load Picture According to i Value(If Pictures are     Named as Pic1,Pic2,Pic3,Pic4 Then it'll be easy
   If i = 4 Then
    i = 0
   End If
End Sub

/*   End Code   */

I Hope this'll Helps U.


Regards,
Nambi



Avatar of n-generation

ASKER

There is something I forgot to mention.  Well I want the image to rotate at its centre.  So it is essentially displaying and hiding the images in turns.  so I can use a timer.  But how can I stop the rotattion after say two/three complete rotations?

ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well, there is a problem here: i just answer the last part of your question. Which one deserves the points for the rest of the problem. I could award her/him from my own bag.
C'mon!, i don't like points like this!!
Any commenter?, inthedark?,sazhagianambi?, Dhaest? or you, n-generation?
Hi richie it must be your lucky day! It could be a good day to invest in the stock market.