# Function Reference

# _GDIPlus_StringFormatSetLineAlign

Sets the line alignment of a StringFormat object in relation to the origin of a layout rectangle

#include <GDIPlus.au3>
_GDIPlus_StringFormatSetLineAlign ( $hStringFormat, $iStringAlign )

## Parameters

$hStringFormat | Pointer to a StringFormat object
$iStringAlign | Type of line alignment to use: 0 - Alignment is towards the origin of the bounding rectangle 1 - Alignment is centered between origin and the height of the formatting rectangle 2 - Alignment is to the far extent (right side) of the formatting rectangle

## Return Value

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

## Remarks

The line alignment setting specifies how to align the string vertically in the layout rectangle.
The layout rectangle is used to position the displayed string.

## Related

_GDIPlus_StringFormatSetAlign

## See Also

Search GdipSetStringFormatLineAlign in MSDN Library.

## Example

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

    Example()

    Func Example()
        Local $hWnd = GUICreate("GDI+ Example (" & @ScriptName & ")", 400, 300)
        GUISetState(@SW_SHOW)

        _GDIPlus_Startup()
        Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
        _GDIPlus_GraphicsClear($hGraphics)

        Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF009900)
        Local $hFamily = _GDIPlus_FontFamilyCreate("Arial")
        Local $hFont = _GDIPlus_FontCreate($hFamily, 36)
        Local $hLayout = _GDIPlus_RectFCreate(0, 0, 400, 300)
        Local $hStringFormat = _GDIPlus_StringFormatCreate()
        _GDIPlus_StringFormatSetAlign($hStringFormat, 1)
        _GDIPlus_StringFormatSetLineAlign($hStringFormat, 1)
        _GDIPlus_GraphicsDrawStringEx($hGraphics, "AutoIt Rocks", $hFont, $hLayout, $hStringFormat, $hBrush)

        Do
            Local $iMsg = GUIGetMsg()
        Until $iMsg = $GUI_EVENT_CLOSE

        _GDIPlus_BrushDispose($hBrush)
        _GDIPlus_FontFamilyDispose($hFamily)
        _GDIPlus_FontDispose($hFont)
        _GDIPlus_StringFormatDispose($hStringFormat)
        _GDIPlus_GraphicsDispose($hGraphics)
        _GDIPlus_Shutdown()
    EndFunc   ;==>Example