For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > November 2005 > animation Effects









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author animation Effects
jack

2005-11-28, 3:55 am

Hi all ,,
just curious for about the animation effect about vb


As i was playing card game i have noticed the animation of the game ..
I have tryed a lot to create an smoot animation effect like this one
but unable to do so

Please do reply me for this

Thanks for Replying

Larry Serflaten

2005-11-28, 6:55 pm


"jack" <gautams.mail@gmail.com> wrote
> Hi all ,,
> just curious for about the animation effect about vb
>
>
> As i was playing card game i have noticed the animation of the game ..
> I have tryed a lot to create an smoot animation effect like this one
> but unable to do so
>
> Please do reply me for this



You have to supply all the animated frames like a movie film, and
copy them into place very rapidly. To get it to look smooth, you
have to make smaller changes, which means more frames. But
copying them over takes time until eventually its going to be a
trade off between how smooth is acceptable for the speed you
want.

For one such method of copying over a picture, and comparing
'smoothness', add a Picture box and a Timer to a new form and
try out the code below:

HTH
LFS


Option Explicit
Private Frames As Collection

Private Sub Form_Load()
Set Frames = New Collection
DrawFrames
Timer1.Interval = 100 ' Decrease to 10 for more speed
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Picture1.Picture = Frames(1)
Frames.Add Frames(1)
Frames.Remove (1)
End Sub

Sub DrawFrames()
Dim fra As Long
Dim inc As Single
Dim ang As Single
Dim smooth As Long

Picture1.Move 300, 300, 2000, 2000
Picture1.AutoRedraw = True
Picture1.FillColor = vbWhite
Picture1.FillStyle = vbSolid
smooth = 8 ' Increase for more smoothness
inc = Atn(1) / smooth
For fra = 1 To smooth * 8
Picture1.Cls
Picture1.BackColor = Me.BackColor
Picture1.Print "FRAME:"; fra
Picture1.Circle (1000 + Sin(ang) * 600, 1000 + Cos(ang) * 600), 300, vbBlack
Frames.Add Picture1.Image
ang = ang + inc
Next
Picture1.AutoRedraw = False
End Sub




jack

2005-11-29, 3:55 am

Thanks
Mike Williams and Larry Serflaten

This is a good the basic anamition example....

But how to replicate the slide effect of the card game soliter in
visualbasic this is what im trying the animation effect which i am
getting is bit slow and not smooth enough more over
im doing this with the use of timer control .. can this be done with
out a timer control


Thanks for repliing

NickHK

2005-11-29, 3:55 am

jack,
If you want THOSE cards and effects, you can use the file that Windows uses:
http://www.developer.com/net/vb/article.php/3303671

NickHK

"jack" <gautams.mail@gmail.com> wrote in message
news:1133239314.235239.65940@g49g2000cwa.googlegroups.com...
> Thanks
> Mike Williams and Larry Serflaten
>
> This is a good the basic anamition example....
>
> But how to replicate the slide effect of the card game soliter in
> visualbasic this is what im trying the animation effect which i am
> getting is bit slow and not smooth enough more over
> im doing this with the use of timer control .. can this be done with
> out a timer control
>
>
> Thanks for repliing
>



jack

2005-11-29, 7:55 am

Got that but really done know now how to do it will read the artical u
have given and then repost if any problem

Thanks for replying

Mike Williams

2005-11-29, 7:55 am

"jack" <gautams.mail@gmail.com> wrote in message
news:1133258254.278428.28300@g47g2000cwa.googlegroups.com...

> Got that but really done know now how to do it will read the
> artical u have given and then repost if any problem


Don't get too involved in the article posted by NickHK. The code samples are
in that horrible dotnet thing. Nothing to do with VB6.If you want details of
how to use the cards.dll library then there are lots of tutorials and demos
around. Just type "vb6 +cards.dll" into Google and you'll get loads of hits,
such as this one:

http://www.programmersheaven.com/zone8/cat539/26981.htm

The cards.dll library gives you an easy way to draw cards, but it doesn't
actually give you any way of animating them. That's easy to do though. So,
you can either look at the various cards.dll links and study the use of the
dll to draw playing cards, or you can post again here for general advise on
smoothly moving or animating pictures (of anything) around the screen.
Choose what you want to do first and post again here if necessary.

Mike


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com