Tim wrote:
Does Win32::GUI provide any means of capturing a specified rectangular
region within a window. This would be an extremely useful feature which is
not available anywhere else in Perl-world (to my knowledge).

Search the Win32 API for "Capturing an Image", then do your stuff with Win32::API. Then turn it into a module and make the world a happier place, not to mention making Perl a more capable language :)


The keywords are: CreateCompatibleBitmap, CreateCompatibleDC and BitBlt. A short quote from the API docs:

"You can use a bitmap to capture an image, and you can store the captured image in memory, display it at a different location in your application's window, or display it in another window.

...

To store an image temporarily, your application must call CreateCompatibleDC to create a DC that is compatible with the current window DC. After you create a compatible DC, you create a bitmap with the appropriate dimensions by calling the CreateCompatibleBitmap function and then select it into this device context by calling the SelectObject function.

After the compatible device context is created and the appropriate bitmap has been selected into it, you can capture the image. The Win32 API provides the BitBlt function to capture images."


/J

------ ---- --- -- -- -- -  -   -    -        -
Johan Lindström                    Boss Casinos
Sourcerer                     [EMAIL PROTECTED]
                 http://www.bahnhof.se/~johanl/
If the only tool you have is a hammer,
everything tends to look
like a nail


Reply via email to