Results 1 to 2 of 2

Thread: frame movement

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Philadelphia
    Posts
    47

    Talking

    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?

    U S A
    Visual Studio .NET
    Windows XP

  2. #2
    Guest
    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width