Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Animations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kingkirb
Squire

United Kingdom
19 Posts

Posted - Jun 01 2006 :  06:41:13 AM  Show Profile  Reply with Quote
How do i go about adding a pre animated image to VB? Basicly ive got some animated images i made and i was wondering if i can jsut add the file instead of using a timer and adding every individual frame. Thanks J(kingkirb)

kingkirb
Squire

United Kingdom
19 Posts

Posted - Jun 01 2006 :  07:11:26 AM  Show Profile  Reply with Quote
ok now ive confused myself. When i try to make the animation using indvidual frames what im doing is i have a timer set to check what picture is imagebox then if its frame1 change it to frame 2 etc except i am not sure how to fins the name of the picture file it loads. I tried to have the image then get the program to print the value of image1.picture and it gives a number, but then when i load the program and do it again it gives a completly different number,everytime. how do i get VB to understand what file im looking for? J(kingkirb)

Go to Top of Page

Dark_Lord
Squire

12 Posts

Posted - Jun 01 2006 :  11:13:37 AM  Show Profile  Reply with Quote
hey kingkirb, i dont understand what you really mean.

If you want to add the animated image, try to save it in *.gif format in the software you created it in and then try to load it in image or picturebox. I think image would suite it much well.

Go to Top of Page

PW7962
Squire

USA
33 Posts

Posted - Jun 01 2006 :  2:29:11 PM  Show Profile  Visit PW7962's Homepage  Send PW7962 an AOL message  Reply with Quote
ok so basically when you load an image through a picturebox it saves it to memory. An d the different number you get each time is the pictures location in memory. To load a file into a picturebox use this:
picture1.Picture = loadpicture(file)

Then interchange file with the location of the image you want on your computer. I believe that should answer your question.

Star Fantasy Unlimited Programmer

http://starfantasy.forumer.com
Go to Top of Page

Walrus
Squire

Slovenia
34 Posts

Posted - Jun 01 2006 :  3:50:50 PM  Show Profile  Reply with Quote
I, too, am not 100% sure what you mean. I think I know, though.

Try like this:
  
Private ArrayOfPics(1 To 3) As Picture  
  
Private Sub Form_Load()  
    Set ArrayOfPics(1) = LoadPicture(file1)  
    Set ArrayOfPics(2) = LoadPicture(file2)  
    Set ArrayOfPics(3) = LoadPicture(file3)  
End Sub
  
Private Sub Timer1_Timer()  
    Static i As Long
  
    If i = UBound(ArrayOfPics) Then
        i = 1  
    Else
        i = i + 1  
    End If
  
    Image1.Picture = ArrayOfPics(i)  
End Sub
  
Go to Top of Page

kingkirb
Squire

United Kingdom
19 Posts

Posted - Jun 11 2006 :  2:14:23 PM  Show Profile  Reply with Quote
Sorry this reply took so long ive not ben weel this past week. Ok loading the picture file it doesnt seem to work for me. i tried putting file equal to

C:\Documents and Settings\Jason guthrie\My Documents\My Pictures\Game Pictures\Animations\Attack1

and i keep getting the run time error 75. path/file access error

For the array of pics. that would work well but when i use seperate pictures due to the same problem as above i get a black flashy bit in the back of the pictures and it annoys me.

What im trying to do is ive got an animation made up. it plays fine by itself but when i try to integrate it into my game so that i can jsut play the file in VB it doesnt work. i tried using a OLE but i cant get any format to work(this is OLE format not GIF etc format).

Do i have to make these animations frame by frame in VB??
Thanks for your help. J(kingkirb)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.