Jump to content

Recommended Posts

Posted

Hi there! ;)

I'm using IE Embedded into a GUI and I want to make a screencapture from all the IE actual page. Not only the part that is currently visible!

Visible:

Posted Image

Full:

Posted Image

Is this possible?

I've already tryed using _ScreenCapture_CaptureWnd B)

Thanks! :)

Posted

This is one try from eukalyptus

#cs **************************************************************************

 kompletter Screenshot einer Webseite

 [url="http://www.autoit.de/index.php?page=Thread&postID=74641#post74641"]http://www.autoit.de/index.php?page=Thread&postID=74641#post74641[/url]

#ce **************************************************************************

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>

Global [email="$iDX=@DesktopWidth"]$iDX=@DesktopWidth[/email]
Global [email="$iDY=@DesktopHeight"]$iDY=@DesktopHeight[/email]

SplashTextOn("Erstelle Snapshot","Bitte warten...",250,70)

$oIE = _IECreateEmbedded()
$hGUI=GUICreate("Embedded Web control Test", $iDX, $iDY,0,0,BitOR($WS_CLIPCHILDREN, $WS_POPUP));,$WS_EX_TOPMOST)
$hObj=GUICtrlCreateObj($oIE, -2, -2, $iDX+4, $iDY+4)
GUISetState(@SW_SHOW)

_IENavigate($oIE,"[url="http://www.autoit.de"]www.autoit.de[/url]")
_IELoadWait($oIE,1000)

SplashOff()

$oIE.document.body.Scroll = "no"
$oIE.document.body.style.border = "0px"
$iX=$oIE.document.body.scrollWidth
$iY=$oIE.document.body.scrollHeight
If $iX < $oIE.document.body.clientWidth Then $iX=$oIE.document.body.clientWidth
If $iY < $oIE.document.body.clientHeight Then $iY=$oIE.document.body.clientHeight
If $iX < $iDX Then $iX=$iDX
If $iY < $iDY Then $iY=$iDY

_GDIPlus_Startup()
$tempGraph = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iX,$iY,$tempGraph)
_GDIPlus_GraphicsDispose($tempGraph)
$hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap)

$iSX=Floor($iX/$iDX)
$iSY=Floor($iY/$iDY)
$iRX=Mod($iX,$iDX)
$iRY=Mod($iY,$iDY)
For $i=0 To $iSX
    For $j=0 To $iSY
        $oIE.document.parentwindow.scroll($i*$iDX,$j*$iDY)
        _ScreenCapture_CaptureWnd(@TempDir & "\TempSnapshot.bmp",$hGUI,0,0,-1,-1,False)
        $hImage=_GDIPlus_ImageLoadFromFile(@TempDir & "\TempSnapshot.bmp")
        $iTX=$i*$iDX
        If $i=$iSX Then $iTX-=$iDX-$iRX
        $iTY=$j*$iDY
        If $j=$iSY Then $iTY-=$iDY-$iRY
        _GDIPlus_GraphicsDrawImage($hGraphics,$hImage,$iTX,$iTY)
        _GDIPlus_ImageDispose($hImage)
    Next
Next
_GDIPlus_ImageSaveToFile($hBitmap,@ScriptDir & "\Snapshot.bmp")
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()
FileDelete(@TempDir & "\TempSnapshot.bmp")

Look here: http://www.autoit.de/index.php?page=Thread&threadID=9818 (German!)

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

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
×
×
  • Create New...