Hi all!
Question: Whats the best way to add animation to a VC++ Windows program? eg. You click a button and a person walks across the screen?
Thankyou all!!!
Weever~
Hi all!
Question: Whats the best way to add animation to a VC++ Windows program? eg. You click a button and a person walks across the screen?
Thankyou all!!!
Weever~
mhm.. the bestway?
maybe a video! you load a video file and display it...
or you can animate a few images yourself with a timer...
depends on what do you want to do
Hope you don't mind my bad english, I'm Austrian!
Sorry, I better give a bit more info . Basically I want to write an interactive program that teaches people how to play cards using animation and images rather than just writhing a plain old Word document or power point presentation. eg. I want a card to move to the middle of the screen when the user presses next or if a computer player looses, there would be an animated squence of the player falling off their seat.
I want to make it clear I am not programming a game, just a teaching aid, so all events will happen in an ordered sequence.
I hope I've made it a little clearer now.
Thankyou all,
Weever~
Sadly, animation in windows is no trivial affair. It demands a lot of work and development. Right now I am working on a C++ class which will automate most of it and I will post it in a couple of weeks. Until then, though(and I'm away from my compiler so I cannot be too specific), basically, you must create one HBITMAP for each 'frame' in the animation, plus an HBITMAP for the corresponding 'mask' of each frame. You must perform I think 6 BitBlt operations that AND/OR/INVERT, etc, each frame and it's mask onto the background. A very yucky process indeed!
Check back for that C++ class, though...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
I have a sample of code.... if you would like it.... I wrote a black jack game which displays some cards and chips... and has some primitive sound effects.... email me if you want a copy....
zMan
by the way enter www.cprogramming.com on the subject line.... I get a lot of junk email....
zMan
Its not that hard to do, if you just want to get started, using GDI you can just load a sequence of images and play them back a a sample rate by timechecking (SYSTEMTIME == SYSTEMTIME) or w/e formula, or just slwo ur prog down w/ 'Sleep'.
However you choose to do it, its not "that" hard to get going, its once you start doing professional grade in anything thats hard... also I dont think (not that its a bad thing) that you could'ent have thoguth of how to do with w/o this board.... I mean theres only one way I know of movies work...
Have fun! SPH
I have wirtten you a little program, it will play 'simple' Bitmap based animations, and not all of the meath if "perfect", feal free to touchb it up and intergrate it all into anything u need... this is just an example (It should be attached to this message).
SPH
P.S. If you have any "extensive" questions... IM or Email Me: (Adresses / SN's are in my profile).
I've got a couple of ideas now so thank you for all your help, but I've used both OpenGL and DirectX to produce various forms of animation before. Am I best just sticking with one of these and integrating it into the rest of the Windows program?
Thanx,
weever~
So am I best just using one of the graphical API's I mentioned above or is there some way of importing animated clips created in something like Director?
Thanx,
Weever~