还是我来吧
#include <IE.au3>
#include <ScreenCapture.au3>
$oIE = _IECreate("http://www.baidu.com")
$su = _IEGetObjById($oIE, "su")
;元素矩形
$dLeft = $su.getBoundingClientRect().left
$dTop = $su.getBoundingClientRect().top
$dRight = $su.getBoundingClientRect().right
$dBottom = $su.getBoundingClientRect().bottom
$hCtrl = ControlGetHandle(HWnd($oIE.hwnd), "", "Internet Explorer_Server1")
Local $tPoint = DllStructCreate($tagPOINT)
DllStructSetData($tPoint, "X", $dLeft)
DllStructSetData($tPoint, "Y", $dTop)
_WinAPI_ClientToScreen($hCtrl, $tPoint)
$x = DllStructGetData($tPoint, "X")
$y = DllStructGetData($tPoint, "Y")
_ScreenCapture_Capture(@ScriptDir & "\new.jpg", $x, $y, ($dRight - $dLeft) + $x, ($dBottom - $dTop) + $y)
ShellExecute(@ScriptDir & "\new.jpg")
|