Click to See Complete Forum and Search --> : Size options when capturing a window


Psytherium
June 22nd, 2006, 12:58 PM
I know you can specify the size and area of a window I want to capture with Bitblt, but is there a way to do this with PrintWindow? I'd really rather not have to make a window be pushed to the foreground to capture it or have to edit the bitmap after it's captured.

golanshahar
June 22nd, 2006, 01:40 PM
This article might help you Capturing Windows Regardless of Their Z-Order
(http://www.codeguru.com/cpp/g-m/gdi/capturingimages/article.php/c11231/)

Cheers

Psytherium
June 22nd, 2006, 02:06 PM
If I'm not mistaken, isn't PrintWindow the only thing that allows you to capture windows regardless of z-order? I messed around with that code, and just by commenting out the PrintWindow line, it causes the window to just be black.

Also, I think I was a little unclear in what I meant with the size of the window. Say I have a window that is 800x600. I just want to capture from (200,200)-(400,200), (200, 400)-(400,400). I can do this with BitBlt by modifying nWidth, nHeight, xSrc, and ySrc. So it's more like the area of a window I want to capture. My apologies for the confusion.

golanshahar
June 22nd, 2006, 03:38 PM
If I'm not mistaken, isn't PrintWindow the only thing that allows you to capture windows regardless of z-order?

I don’t know if its the only one, its the one I know of :D


I messed around with that code, and just by commenting out the PrintWindow line, it causes the window to just be black.


Well if you don’t call ::PrintWindow() of course you will get black image cause you getting the bits from un-initialized bitmap handle.

Cheers