Results 1 to 7 of 7

Thread: Animation on screen DC

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Perth, WA
    Posts
    17

    Animation on screen DC

    I've been trying to animate a bitmap onto the screen DC, but haven't been able to manage it properly. I can animate bitmaps fine on forms etc with bitblt, but the screen DC is different as there is no .cls and .refresh.

    The main problem is that I have not been able to get rid of the flickering caused by using redrawwindow (so that the bitmap doesn't leave a copy of itself behind as it moves around). Does anyone know of a way to stop the screen from refreshing until it has been cleared and the bitmap redrawn?

    Cheers...

  2. #2
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well this is how I did it:

    first I copied the part of the screen that I wanted to do the animation on than I blitted my pic on that copy and blitted it back instead of cleaning up the screen by the redrawWindow thing...
    I hope you got me...
    Sanity is a full time job

    Puh das war harter Stoff!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Perth, WA
    Posts
    17
    Yup, I think I got you.. trouble is that when I blit straight from the screen DC to the backbuffer it still has the last frame's picture on it.. i.e. I need to clean off everything i'd already blitted before the next frame, otherwise the next frame will include everything for the last frame. Or am I missing something?

  4. #4
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    that is true that is why you have to make a copy first don't blit the copy of the screen directly on the backbuffer but into a dc first than from that dc to the backbuffer and than you animpic... pretty straight....
    Sanity is a full time job

    Puh das war harter Stoff!

  5. #5
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well I just saw you are on right this moment
    so if you want to add me to icq the number in my signature is my UIN
    Sanity is a full time job

    Puh das war harter Stoff!

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Perth, WA
    Posts
    17
    Yeh, thats one option.. but what if the user moves/minimises/maximises/loads/unloads a window? This isn't reflected in the backbuffer, which still shows the screen in the state it was when the animation first started.

    I suppose you could redraw the screen and refresh the backbuffer every second or so.. hopefully then both the flicker and the ghost effect caused by a moving window wouldn't be too noticeable. I was hoping that there would be a better solution, though.

    Thanks for the help, btw

  7. #7
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    you could check for new windows beeing created...

    well I can see your problem, I will think about it.
    my animation was a little ostrich running over the screen so it never remained at one place for a longer time anyways so I had to do a lot more of getting a writing to the desktop dc anyways.. (I only wrote lines, so I would not have to blt to much to the desktop since this is the critical moment that creates flikering)
    Sanity is a full time job

    Puh das war harter Stoff!

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