Function _IrrGetScreenShot

au3Irr2

au3Irr2 Function Reference

_IrrGetScreenShot

Return a pointer to a texture containing a rectangular portion of a screenshot.

#Include <au3Irrlicht2.au3>
_IrrGetScreenShot($i_XPos, $i_YPos, $i_Width, $i_Height)

 

Parameters

$i_XPos X position for the screenshot
$i_YPos Y position for the screenshot
$i_Width Width of the screebshot
$i_Height Height of the screebshot

 

Return Value

Success: Pointer to a texture containing a rectangular portion of a screenshot.
Failure: False and @error 1

 

Remarks

None

 

Related

_IrrSaveScreenShot, _IrrDraw2DImage, _IrrDraw2DImageElement, _IrrDraw2DImageElementStretch

 

Example


#include "au3Irrlicht2.au3"

Global $hTexture, $camera, $mesh, $sceneNode, $texture

_IrrStart()

; Just adding some props to the scene, so we can get a screenshot of something
$camera = _IrrAddCamera(2,2,2, 0,0,0 )
$mesh = _IrrGetMesh( ".\media\capsuleX.obj" )
$sceneNode = _IrrAddMeshToScene( $mesh )
$texture = _IrrGetTexture(".\media\default_texture.png")
_IrrSetNodeMaterialTexture( $sceneNode, $texture, 0)
_IrrSetNodeMaterialFlag( $sceneNode, $IRR_EMF_LIGHTING, $IRR_OFF )


WHILE _IrrRunning()

    _IrrBeginScene(50, 50, 50)

    ; We want the props to be drawn before we take a screenshot.
    _IrrDrawScene()

    ; This will draw our screenshot scaled down to the top left of the window
    If $hTexture Then _IrrDraw2DImageElementStretch($hTexture, 0, 0, 200, 150, 0, 0, 800, 600, $IRR_IGNORE_ALPHA)

    _IrrEndScene()

    ; Taking a screenshot just once now the props have been drawn.
    If Not $hTexture Then $hTexture = _IrrGetScreenShot(0, 0, 800, 600)

WEND

_IrrStop()