GdipAddPathArcfunction
Adds an elliptical arc to the current figure of this path.
Syntax
FUNCTION GdipAddPathArc (BYVAL path AS GpPath PTR, BYVAL x AS REAL, BYVAL y AS REAL, BYVAL width AS REAL, BYVAL height AS REAL, BYVAL startAngle AS REAL, BYVAL sweepAngle AS REAL) AS GpStatus
GdipAddPathArcI — one description covers them all.Parameters
| Name | Description | |
|---|---|---|
path | [in] Pointer to the GraphicsPath object. | |
x | [in] The x-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc. | |
y | [in] The y-coordinate of the upper-left corner of the bounding rectangle for the ellipse that contains the arc. | |
width | [in] The width of the bounding rectangle for the ellipse that contains the arc. | |
height | [in] The height of the bounding rectangle for the ellipse that contains the arc. | |
startAngle | [in] The clockwise angle, in degrees, between the horizontal axis of the ellipse and the starting point of the arc. | |
sweepAngle | [in] The clockwise angle, in degrees, between the starting point (startAngle) and the ending point of the arc. |
Description
Adds an elliptical arc to the current figure of this path.
Example
' ======================================================================================== ' The following example draws a 90-degree arc. ' ======================================================================================== SUB Example_DrawArc (BYVAL hdc AS HDC)
DIM hStatus AS LONG
' // Create a graphics object from the device context DIM graphics AS GpGraphics PTR hStatus = GdipCreateFromHDC(hdc, @graphics)
' // Get the DPI scaling ratios DIM dpiX AS SINGLE hStatus = GdipGetDpiX(graphics, @dpiX) DIM rxRatio AS SINGLE = dpiX / 96 DIM dpiY AS SINGLE hStatus = GdipGetDpiY(graphics, @dpiY) Dim ryRatio AS SINGLE = dpiY / 96 ' // Set the scale transform hStatus = GdipScaleWorldTransform(graphics, rxRatio, ryRatio, MatrixOrderPrepend)
' // Create a GraphicsPath object and initializes the fill mode. DIM path AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @path)
' // Adds an elliptical arc to the current figure of this path.
hStatus = GdipAddPathArc(path, 140, 15, 100, 150, 0, 180) ' // Closes the current figure of the path. hStatus = GdipClosePathFigure(path)
' // Create a red pen DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_RED, 1, UnitWorld, @pen) ' // Draw the path. hStatus = GdipDrawPath(graphics, pen, path)
' // Cleanup IF pen THEN GdipDeleteBrush(pen) IF path THEN GdipDeletePath(path) IF graphics THEN GdipDeleteGraphics(graphics)
END SUB ' ========================================================================================
Reference
- Defined in AfxNova/AfxGdiPlus.bi:2006
- Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
- Topic: GraphicsPath Functions