GdipAddPathEllipseIfunction
Adds an ellipse to this path.
Syntax
FUNCTION GdipAddPathEllipseI (BYVAL path AS GpPath PTR, BYVAL x AS INT_, BYVAL y AS INT_, BYVAL width AS INT_, BYVAL height AS INT_) AS GpStatus
GdipAddPathEllipse — 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. | |
y | [in] The y-coordinate of the upper-left corner of the bounding rectangle for the ellipse. | |
width | [in] The width of the bounding rectangle for the ellipse. | |
height | [in] The height of the bounding rectangle for the ellipse. |
Description
Adds an ellipse to the path.
Remarks
A GraphicsPath object stores an ellipse as a sequence of four connected Bézier splines. The GraphicsPath object does not store the upper-left corner, width, and height of the ellipse's bounding rectangle.
Example
' ======================================================================================== ' This example draws an ellipse using GdipAddPathEllipse. ' ======================================================================================== SUB Example_DrawEllipse (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)
' // Add ellipse to path hStatus = GdipAddPathEllipse(path, 100, 70, 200, 100)
' // Create pen DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_MAGENTA, 2, UnitWorld, @pen)
' // Draw 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:2045
- Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
- Topic: GraphicsPath Functions