Skip to main content
gamedev.net
🔒 Locked

BitBlt help

Started by ksjetski 3 replies 750+ views
Original Post
ksjetski
ksjetski
How do I have BitBlt grab an image from another window then display it in the parent window using c/c++?
Evil Steve
Evil Steve
You can only do it if the other window is completely visible. If it's not, then the contents of the window don't exist.

If it is visible, you can call GetDC() on both windows, then just BitBlt to blit from one window to another. But I suspect the other window isn't visible, is it?

EDIT: You may find This relevant.
ksjetski
ksjetski
Yes the other window is visible
Skizz
Skizz
Just thinking off the top of my head here (about to leave work) but I wonder if there's a way to send a redraw message to the other window and specify the DC to use for drawing. This might be possible as this could be the mechanism by which print screen works.

Skizz
Evil Steve
Evil Steve
Quote:
Original post by Skizz
Just thinking off the top of my head here (about to leave work) but I wonder if there's a way to send a redraw message to the other window and specify the DC to use for drawing. This might be possible as this could be the mechanism by which print screen works.
Interesting idea. Although it depends if HDCs can be shared between processes (Which I doubt, unfortunately).

EDIT: Assuming the other window is in another process, of course.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.