Fill a pie
#include <GDIPlus.au3>
_GDIPlus_GraphicsFillPie ( $hGraphics, $nX, $nY, $nWidth, $nHeight, $fStartAngle, $fSweepAngle [, $hBrush = 0] )
$hGraphics | Handle to a Graphics object |
$nX | The X coordinate of the upper left corner of the rectangle that bounds the ellipse in which to draw the pie |
$nY | The Y coordinate of the upper left corner of the rectangle that bounds the ellipse in which to draw the pie |
$nWidth | The width of the rectangle that bounds the ellipse in which to draw the pie |
$nHeight | The height of the rectangle that bounds the ellipse in which to draw the pie |
$fStartAngle | The angle, in degrees, between the X axis and the starting point of the arc that defines the pie. A positive value specifies clockwise rotation. |
$fSweepAngle | The angle, in degrees, between the starting and ending points of the arc that defines the pie. A positive value specifies clockwise rotation. |
$hBrush | [optional] Handle to a brush object that is used to fill the pie. If 0, a black brush will be used. |
Success: | True. |
Failure: | False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3). |
Search GdipFillPie in MSDN Library.
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $hGUI, $hGraphic
; Create GUI
$hGUI = GUICreate("GDI+", 400, 300)
GUISetState(@SW_SHOW)
; Fill a pie
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsFillPie($hGraphic, 150, 80, 100, 100, 45, 90)
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc ;==>Example
#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(0xFF8080A0) ;color format AARRGGBB (hex)
_GDIPlus_GraphicsFillPie($hGraphics, 100.5, 0.5, 400.75, 400.125, 45, 90, $hBrush)
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
;cleanup GDI+ resources
_GDIPlus_PenDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
GUIDelete($hGUI)
EndFunc ;==>Example