|
-
Mar 22nd, 2002, 05:03 AM
#1
Thread Starter
Junior Member
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...
-
Mar 22nd, 2002, 11:08 AM
#2
Frenzied Member
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!
-
Mar 22nd, 2002, 12:28 PM
#3
Thread Starter
Junior Member
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?
-
Mar 22nd, 2002, 01:03 PM
#4
Frenzied Member
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!
-
Mar 22nd, 2002, 01:04 PM
#5
Frenzied Member
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!
-
Mar 22nd, 2002, 01:49 PM
#6
Thread Starter
Junior Member
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
-
Mar 22nd, 2002, 02:56 PM
#7
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|