Emerican
Dec 14th, 2000, 10:43 AM
using the windows multimedia apis, i am able to display an avi on my form, however what i want to do is have that avi move around the form like the bouncing ball in hte samples you know, but the only problem is that when i use a timer control, the movement is much too choppy, is there any way to automate this movement in bitblt or another api or faster method?
You've actually got 2 potential slow-downs:
1) timer controls can't go much below 50 ms acurately
The way to go around this is to use Sleep or use a loop with GetTickCount
do
'update position
Sleep (10) 'will halt the program for 10 ms
loop
OR:
dim Tick as long
do
Tick=GetTickCount
'update position
do:doevents:loop until GetTickCount-Tick>=10
loop
The problem of the first way is that it will always wait 10 ms for every loop no matter how lont the loop executes (this will make it go different speeds on different computers). The second way sets a minimum limit of 10 ms on executing the loop.
2) The other slow-down could be in the way you play your avi's. It depends on what type of control you are using to do that so I can't help you there. But unless you want to write code to read and interpret the avi file you'll be better off using a control to do that than BitBlt.