Function Reference


_GDIPlus_GraphicsFillEllipse

Fill an ellipse

#include <GDIPlus.au3>
_GDIPlus_GraphicsFillEllipse ( $hGraphics, $nX, $nY, $nWidth, $nHeight [, $hBrush = 0] )

Parameters

$hGraphics Handle to a Graphics object
$nX The X coordinate of the upper left corner of the rectangle that bounds the ellipse
$nY The Y coordinate of the upper left corner of the rectangle that bounds the ellipse
$nWidth The width of the rectangle that bounds the ellipse
$nHeight The height of the rectangle that bounds the ellipse
$hBrush [optional] Handle to a brush object that is used to fill the ellipse. If 0, a black brush will be used.

Return Value

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

See Also

Search GdipFillEllipse in MSDN Library.

Example

Example 1

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

Example()

Func Example()
    Local $hGUI, $hGraphic

    ; Create GUI
    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetState(@SW_SHOW)

    ; Draw an ellipse
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    _GDIPlus_GraphicsFillEllipse($hGraphic, 130, 100, 140, 70)

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

    ; Clean up resources
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example

Example 2

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

Example()

Func Example()
    _GDIPlus_Startup() ;initialize GDI+
    Local Const $iWidth = 600, $iHeight = 600, $iBgColor = 0x303030 ;$iBgColor format RRGGBB

    Local $hGUI = GUICreate("GDI+ Example (" & @ScriptName & ")", $iWidth, $iHeight) ;create a test GUI
    GUISetBkColor($iBgColor, $hGUI) ;set GUI background color
    GUISetState(@SW_SHOW)

    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle
    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;sets the graphics object rendering quality (antialiasing)
    Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFE0A0FF) ;color format AARRGGBB (hex)

    _GDIPlus_GraphicsFillEllipse($hGraphics, 10.5, 50.1, 580.25, 500.75, $hBrush)

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ;cleanup GDI+ resources
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
EndFunc   ;==>Example