Function _IrrDraw2DImageElementStretch

au3Irr2

au3Irr2 Function Reference

_IrrDraw2DImageElementStretch

Draws specified rectangle from Source texture sizing it to fit the specified Desination rectangle.

#Include <au3Irrlicht2.au3>
_IrrDraw2DImageElementStretch($h_Texture, $i_DestTopX, $i_DestTopY, $i_DestBottomX, $i_DestBottomY, $i_SourceTopX, $i_SourceTopY, $i_SourceBottomX, $i_SourceBottomY, $i_UseAlpha)

 

Parameters

$h_Texture Handle to an irrlicht image object
$i_DestTopX Top X Destination where the drawing will start.
$i_DestTopY Top Y Destination where the drawing will start.
$i_DestBottomX Bottom X Destination where the drawing will end.
$i_DestBottomY Bottom Y Destination where the drawing will end.
$i_SourceTopX X top position of rectangle in the source texture
$i_SourceTopY Y top position of rectangle in the source texture
$i_SourceBottomX X bottom position of rectangle in the source texture
$i_SourceBottomY Y bottom position of rectangle in the source texture
$i_UseAlpha Whether or not to use the alpha channel should be one of the following values:
$IRR_IGNORE_ALPHA
$IRR_USE_ALPHA

 

Return Value

Success: True
Failure: False

 

Remarks

The image is copied from the specified rectangle in the source texture, this enables you to put many images onto a single texture.
If the rectangles are different sizes this function will scale the images appropriately.
This function also supports the alpha channel when drawing the image to the display and can draw the image transparently.

 

Related

_IrrGetTexture, _IrrColorKeyTexture, _IrrDraw2DImageElement

 

Example


#include <au3Irrlicht2.au3>

_IrrStart()

Local $hLogo = _IrrGetTexture("./media/Cross.bmp")

; Use White as Alpha color
_IrrColorKeyTexture($hLogo, 255, 255, 255)

While _IrrRunning()

    _IrrBeginScene(255, 255, 0)

    ; Draw Original texture just to see what the unchanged texture looks like.
    _IrrDraw2DImage($hLogo, 0, 0)

    ;Draw texture smaller using Alpha beside the original.
    _IrrDraw2DImageElementStretch($hLogo, 128, 0, 192, 64, 0, 0, 128, 128, $IRR_USE_ALPHA)

    ;Draw texture Larger using Alpha beside the previous smaller texture.
    _IrrDraw2DImageElementStretch($hLogo, 192, 0, 448, 256, 0, 0, 128, 128, $IRR_USE_ALPHA)

    ;Draw beside Larger texture quarter of source texture to new larger destination not using Alpha.
    _IrrDraw2DImageElementStretch($hLogo, 448, 0, 800, 352, 0, 0, 64, 64, $IRR_IGNORE_ALPHA)

    _IrrEndScene()
WEnd

_IrrStop()