Results 1 to 3 of 3

Thread: Drawing directly to the screen?

  1. #1

    Thread Starter
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457

    Question 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
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  2. #2
    Junior Member
    Join Date
    Mar 2002
    Location
    Perth, WA
    Posts
    17
    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...

  3. #3

    Thread Starter
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Hmm thanks for your reply... I have an idea that might work based on yours, thanks.
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

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