|
|
|
|
![]() ![]() |
Mar 29 2005, 11:12 PM
Post
#1
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 17 Joined: 29-March 05 Member No.: 3,378 |
i was just wondering, when you are useing the program Visual Basic is there any way to add some animation to a form, and if so what is a good(cheep) animation program i could get?
|
|
|
|
Mar 29 2005, 11:56 PM
Post
#2
|
|
|
Advanced Member Group: Members Posts: 169 Joined: 19-January 05 Member No.: 2,221 |
I am going to be learning VB next year so I'll need to pay attention to this for some good pointers.
|
|
|
|
Mar 30 2005, 01:24 AM
Post
#3
|
|
|
Member - Active Contributor Group: Members Posts: 93 Joined: 21-March 05 Member No.: 3,136 |
Refer to following articles for more information:
As far as I know, you can create an animated gif image or flash file then embed them into VB form. Here is one of many tutorials on the net http://www.anim-fx.com/flash-tutorials/insertvb6.html |
|
|
|
Oct 13 2006, 03:16 PM
Post
#4
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 11 Joined: 13-October 06 Member No.: 16,536 |
Note for beginers, the words placed in single quotation marks are comments
Heheheh. This is easy. Very easy. Quick Solutions In VB6, you just need the default controls. Importantly, the Image control (not picture control using that would kill the cpu) and a Timer control. Prepare the slides of the animation. You could do this by taking frame by frame shots of a movie, gif animation, etc. Best way to experiment is with... STICK FIGURES!!! (fine, be Van Goh if you want. But you'll die at frame 3) Rename the frames from 1 to say 32 same file extentions (say .bmp) put it in a folder called Animation1/ Then, create one image control (I hereby declare this control by its default name, Image1). Next, add the Timer Control (blah blah blah as above, Timer1) Set the timer's interval. This will become the the animation's frame interval. Set the timer's enabled to false if you want to pause it, set to true for resuming. Then add this nifty code to the same form as the controls: CODE Dim ImgCounter as Integer 'Use Long if you plan to make a movie out of this' Private Const AniMax as Integer = 33 'Change the number if you like (last frame + 1)' Private sub Timer1_Timer() ImgCounter = ImgCounter + 1 Image1.Picture = LoadPicture(App.Path & "/Animation1/" & Trim(Str(ImgCounter)) & ".bmp" 'change file extention if necessary') If ImgCounter = AniMax Then ImgCounter = 0 'Not 1 or else the next time this function repeats, it'll skip frame 1' End If End Sub Public Function Frame_GoTo(iFrame as Integer) If iFrame < AniMax And iFrame > 0 Then ImgCounter = iFrame Image1.Picture = LoadPicture(App.Path & "/Animation1/" & Trim(Str(ImgCounter)) & ".bmp") End If End Function There. With the extra function you can go to any frame within the range by calling it up. You do this by entering the code: Frame_GoTo('frame no.') Ta da! The simple animation ready to roll. Second Alternative: Create a .avi, .mpeg or .mp4 file and embed it with the program. Instant animaiton. Eats the RAM though, so be careful. |
|
|
|
Jan 17 2007, 12:26 AM
Post
#5
|
|
|
Living at the Datacenter Group: [HOSTED] Posts: 708 Joined: 30-June 06 From: Australia Member No.: 14,219 myCENTs:76.93 |
QUOTE As far as I know, you can create an animated gif image or flash file then embed them into VB form. the visual studio 2005 professional version comes with animations that have to be installed as a optional item. They include all of the animations that were used in earlier versions of windows and include ones like the file copy dialog, file delete, upload to ftp, download files et etc. They are pretty simple but it that is something you are looking for, they can be useful. because they are so large i cannot post them here on the board, but i will try and put them up on my astahost site. ill reply again when they are up! the zipped version is rather large (2.03MB) so be warned! also, since you can embed almost any gif animation into a vb form then any animated gif that you come across on the internet you could possibly use. There are many sites (i wont list them now, but do some googling and you'll find some) that give away animations for royalty-free use. but remember, the more animations and pictures that you add to your forms, the slower the form is going to become to load which will in effect slow down your entire application, so use wisely! good luck -jimmy |
|
|
|
Aug 3 2008, 02:54 AM
Post
#6
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
where is my mistake?
Visual Basic Help I'm trying to complete this code and I'm getting the code from the book. The code is: Private Sub Form_Load() ' Initialize the label's text Dim strLabel1 As String Dim strLabel2 As String Dim StrLabel3 As String Dim StrLabel4 As String StrLabel1 = "use frames if you want" StrLabel2 = " to group options together" StrLabel3 = " Each frame forms one set" StrLabel4 = " of option buttons" LblFrames.Caption= strLabel1&strLabel2&strLabel3&strLabel4 End Sub Now the problem is with the last line , it didn't accept the ampersand after every string name . If you can help with that , please reply. Thank you -question by new student |
|
|
|
Sep 11 2008, 12:18 AM
Post
#7
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 1 Joined: 10-September 08 Member No.: 32,556 |
where is my mistake? Visual Basic Help I'm trying to complete this code and I'm getting the code from the book. The code is: Private Sub Form_Load() ' Initialize the label's text Dim strLabel1 As String Dim strLabel2 As String Dim StrLabel3 As String Dim StrLabel4 As String StrLabel1 = "use frames if you want" StrLabel2 = " to group options together" StrLabel3 = " Each frame forms one set" StrLabel4 = " of option buttons" LblFrames.Caption= strLabel1&strLabel2&strLabel3&strLabel4 End Sub Now the problem is with the last line , it didn't accept the ampersand after every string name . If you can help with that , please reply. Thank you -question by new student The solution is very simple, just add spaces between the string names and the & signs, like this: LblFrames.Caption = strLabel1 & strLabel2 & strLabel3 & strLabel4 |
|
|
|
Sep 12 2008, 11:34 AM
Post
#8
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 8 Joined: 12-September 08 Member No.: 32,592 |
how can i chang extention to each other ? for example how a program written bye vb can convert a gif file to jpg, or other ? this is project for my teacher i have to done.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 5th December 2008 - 03:33 PM |