Help Center

CGpGraphics.DrawEllipsemethod

Draws an ellipse.

GraphicsmethodCGpGraphics.incdocumented

Syntax

FUNCTION DrawEllipse (BYVAL pPen AS CGpPen PTR, BYVAL x AS SINGLE, BYVAL y AS SINGLE, BYVAL nWidth AS SINGLE, BYVAL nHeight AS SINGLE) AS GpStatus
FUNCTION DrawEllipse (BYVAL pPen AS CGpPen PTR, BYVAL x AS INT_, BYVAL y AS INT_, BYVAL nWidth AS INT_, BYVAL nHeight AS INT_) AS GpStatus
FUNCTION DrawEllipse (BYVAL pPen AS CGpPen PTR, BYVAL rc AS GpRectF) AS GpStatus
FUNCTION DrawEllipse (BYVAL pPen AS CGpPen PTR, BYVAL rc AS GpRect) AS GpStatus

Parameters

NameDescription
pPenPointer to a pen that is used to draw the ellipse.
xThe x-coordinate of the upper-left corner of the rectangle that bounds the ellipse.
yThe y-coordinate of the upper-left corner of the rectangle that bounds the ellipse.
nWidthThe width of the rectangle that bounds the ellipse.
nHeightThe height of the rectangle that bounds the ellipse.

Return value

If the function succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.

If the function fails, it returns one of the other elements of the GpStatus enumeration.

Description

Draws an ellipse.

Example

' ======================================================================================== ' The following example draws an ellipse. ' ======================================================================================== SUB Example_DrawEllipse (BYVAL hdc AS HDC)

' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Get the DPI scaling ratio DIM rxRatio AS SINGLE = graphics.GetDpiX / 96 DIM ryRatio AS SINGLE = graphics.GetDpiY / 96 ' // Set the scale transform graphics.ScaleTransform(rxRatio, ryRatio)

' // Draw the ellipse DIM bluePen AS CGpPen = CGpPen(ARGB_BLUE, 3) graphics.DrawEllipse(@bluePen, 100.0, 70.0, 200.0, 100.0)

END SUB ' ========================================================================================

Reference

  • Include file CGpGraphics.inc
  • Defined in AfxNova/CGpGraphics.inc:571
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class