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
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Simply find a bounding box around the image you want to draw, and save the image. Also, you can Set a transparency flag on your window, which causes everything BEHIND the window to be drawn on top of it(I Believe). You could create a window like this, and then draw to that window, like normal. I think that the flag is WS_EX_TRANSPARENT, look it up in MSDN. If that is NOT the flag name, look up the CreateWindowEx() API call. It will be listed in that section.

    Z.

  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
    Thanks... I'll try that and post back tomorrow (sorry I know I posted twice but I can't delete any of the posts hehe )
    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