hey i can make a image move around and such but i want to make it so if i had a little guy his legs would move and he wouldnt have a white background. How would i do this?
Printable View
hey i can make a image move around and such but i want to make it so if i had a little guy his legs would move and he wouldnt have a white background. How would i do this?
Create a set of graphics (frames like in movies) and make them on a black background.
Create the same graphics except on a white background and the image is just a shadow (all black)
Use BitBlt to copy the shadow (mask) with vbSrcAnd
Use BitBlt to copy the black backgrounded pic over the mask with vbSrcPaint
Voila
Try Fox's Site, Theire's an animation programe there,
really good
Not the transparent image using bitblt but the moving the legs thing..... how do you make the image or "guy" have his lefs moving while he moves across the screen
I know how to make the guy move
Private sub timer1_timer()
imgguy.left = imgguy.left - 1
end sub
But how would you make his legs move while he is moving..... you probably have to get 2 different pics but how would you make them appear like that.....
Thanks for all the help.
Like I said, use frames (like stop motion animation)
PLEASE don't tell me you don't know how basic animation works...you have about 25 or 30 frames per second, each frame is a still picture, so that when you draw them quickly they appear to be moving.
Have a control array of picture boxes that store the separate frames, and a variable that tracks the current frame. Whenever you move the actual image, you have to change the frame.
Don't use actual picturebox/imagebox controls that move around; rather, have a big picturebox that doesn't move, and move the coordinates for bitblt.
Some things that might trip you up:
1. Bitblt: See my example.
2. The animation doesn't loop: Add 1 to the frame counter but use the MOD command afterwards, eg.In this, if you had 4 frames and their indicies were 0 to 3, then the code would work. If the indicies are 1 - 4, you must add 1 to the end result when you're using the index, eg.VB Code:
FrameNum = FrameNum + 1 Mod NumFramesVB Code:
Frames(FrameNum + 1).hDC
Ok mlewis..... Dont pee your pants..... By the way thats a stupid way of doing it...... :cool: There must be a way of doing it without soo much code! I dont want to have 30 different frames on 1 page and I am sure as hell not going to bitblt 30 pics............ :p:eek:
:eek: I am going to blow a *%*%*%*%* :eek:
Sorry. Animation is done in frames, that's it. There's no other way to do it.
If you want a full second of animation, you need 30 frames for it to look good. Five seconds needs 150 frames. Ten seconds needs 300...you get the idea.
You can lump all of the frames into one picture, and just bitblt different portions of the pic, but you just have to use frames, sorry.