|
-
Aug 11th, 2002, 12:20 PM
#1
Thread Starter
Frenzied Member
Drawing directly to the screen?
Hi, I'm working on a VB project where I need to draw and animate a small image (with a transparent background) to the screen. I can do it using bitblt and GetWindowDC(0), but I would then need to clear part of the screen when moving it or animating it. I tried using RedrawWindow but it doesn't seem to work. Even if it did, at 25 frames per second it would produce a visible flicker - is there any other way? Or can you at least help me the way I'm doing it? (I've seen lots of programs doing this and they all work perfectly...)
Thanks
-
Aug 13th, 2002, 04:42 AM
#2
Junior Member
I tried doing this a while ago, and ran into all the same problems you have. The best I could do in the end was to keep a backup copy of the screen (minus my image, of course). Once you have that you can use it to create a backbuffer then overwrite your old image with the new without refreshing the screen at all.
In order for this to work I had to keep track of all visible windows as well, and refresh the backup screen image when they moved/minimised/maximised etc. Messy at best. If your image is always going to be in a small area of the screen it might work, though.
Still, i'm sure theres a better way - like you say, theres lots of programs that do it fine...
-
Aug 13th, 2002, 02:15 PM
#3
Thread Starter
Frenzied Member
Hmm thanks for your reply... I have an idea that might work based on yours, thanks.
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
|