Funktionreferenz


_GDIPlus_PenSetTransform


Sets the world transformation of a pen object

#include <GDIPlus.au3>
_GDIPlus_PenSetTransform ( $hPen, $hMatrix )

Parameter

$hPen A pointer to a Pen object.
$hMatrix A pointer to a matrix object that specifies the world transformation.

Rückgabewert

Success: True.
Failure: False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3).

Bemerkungen

None.

Verwandte Funktionen

_GDIPlus_PenResetTransform

Siehe auch

Suche nach GdipSetPenTransform in der MSDN Bibliothek.

Beispiel

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $hGUI = GUICreate("GDI+", 660, 360)
    GUISetState(@SW_SHOW)

    _GDIPlus_Startup()
    Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
    _GDIPlus_GraphicsClear($hGraphic, 0xFF000000)

    Local $hPen = _GDIPlus_PenCreate(0xFF4488FF, 2, 0)
    _GDIPlus_GraphicsDrawRect($hGraphic, 20, 20, 300, 320, $hPen)

    ;Skaliert die Stiftbreite um den Faktor 10 in der horizontalen Richtung und deb Faktor 5 in der vertikalen Richtung
    Local $hMatrix = _GDIPlus_MatrixCreate2(10, 0, 0, 5, 0, 0)
    _GDIPlus_PenSetTransform($hPen, $hMatrix)
    _GDIPlus_GraphicsDrawRect($hGraphic, 340, 20, 300, 320, $hPen)

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    _GDIPlus_PenDispose($hPen)
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example