Function Reference


_GDIPlus_BrushClone

Clone a Brush object

#include <GDIPlus.au3>
_GDIPlus_BrushClone ( $hBrush )

Parameters

$hBrush Handle to a Brush object

Return Value

Success: a handle to a new brush object.
Failure: 0 and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GDIP_ERR* see GPIPlusConstants.au3).

Remarks

When you are done with the Brush object, call _GDIPlus_BrushDispose() to release the resources.

Related

_GDIPlus_BrushDispose

See Also

Search GdipCloneBrush in MSDN Library.

Example

#include "Extras\HelpFileInternals.au3"

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

Example()

Func Example()
    Local $hBrush1, $hBrush2

    ; Create GUI
    GUICreate("GDI+", 400, 300)
    _MemoCreate(2, 2, 596, 396, $WS_VSCROLL)
    GUISetState(@SW_SHOW)

    ; Create brushes
    _GDIPlus_Startup()
    $hBrush1 = _GDIPlus_BrushCreateSolid()
    $hBrush2 = _GDIPlus_BrushClone($hBrush1)

    ; Show brush information
    _MemoWrite("Brush 1 handle : 0x" & Hex($hBrush1))
    _MemoWrite("Brush 1 type ..: " & _GDIPlus_BrushGetType($hBrush1))
    _MemoWrite("Brush 2 handle : 0x" & Hex($hBrush2))
    _MemoWrite("Brush 2 type ..: " & _GDIPlus_BrushGetType($hBrush2))

    ; Clean up resources
    _GDIPlus_BrushDispose($hBrush2)
    _GDIPlus_BrushDispose($hBrush1)
    _GDIPlus_Shutdown()

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example