Sign in to follow this  
Followers 0
monax

Using screencapture

2 posts in this topic

Hi, whats the best approach to capture multiple zones to get multiple files (for example 20 zones, 20 files).

1) Call _ScreenCapture_Capture to each zone

2) Call _ScreenCapture_Capture one time to a large zone (including the subzones) and get the handle to an HBITMAP

3) Call _ScreenCapture_Capture one time to a large zone (including the subzones) and save the file

If I do 2 or 3, what should be done to split that hbitmap-file.

 

 

Other question, I was reading the _ScreenCapture_CaptureWnd function and if I understand correctly, when DwmGetWindowAttribute:DWMWA_EXTENDED_FRAME_BOUNDS fails, it use GetWindowRect Can someone explain me the difference between this two functions?

Share this post


Link to post
Share on other sites



Hi, monax. You could put your coordinates (Left, Top, Right & Bottom) into an array, and loop through the array. Something like this:

#include <ScreenCapture.au3>

Local $aCoords[10][4]

$aCoords[0][0] = 1
    $aCoords[0][1] = 1
    $aCoords[0][2] = 100
    $aCoords[0][3] = 100
$aCoords[1][0] = 1
    $aCoords[1][1] = 10
    $aCoords[1][2] = 110
    $aCoords[1][3] = 110
$aCoords[2][0] = 1
    $aCoords[2][1] = 20
    $aCoords[2][2] = 120
    $aCoords[2][3] = 120
$aCoords[3][0] = 1
    $aCoords[3][1] = 30
    $aCoords[3][2] = 130
    $aCoords[3][3] = 130
$aCoords[4][0] = 1
    $aCoords[4][1] = 40
    $aCoords[4][2] = 140
    $aCoords[4][3] = 140
$aCoords[5][0] = 1
    $aCoords[5][1] = 50
    $aCoords[5][2] = 150
    $aCoords[5][3] = 150
$aCoords[6][0] = 1
    $aCoords[6][1] = 60
    $aCoords[6][2] = 160
    $aCoords[6][3] = 160
$aCoords[7][0] = 1
    $aCoords[7][1] = 70
    $aCoords[7][2] = 170
    $aCoords[7][3] = 170
$aCoords[8][0] = 1
    $aCoords[8][1] = 80
    $aCoords[8][2] = 180
    $aCoords[8][3] = 180
$aCoords[9][0] = 1
    $aCoords[9][1] = 90
    $aCoords[9][2] = 190
    $aCoords[9][3] = 190

For $i = 0 To 9
    _ScreenCapture_Capture(@DesktopDir & "\Test\Pic" & $i & ".png", $aCoords[$i][0], $aCoords[$i][1], $aCoords[$i][2], $aCoords[$i][3])
Next

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0