导航:  GdiPlus Classes > GdiPlus Classes > CGpGraphics Class > Graphics Object >

DrawEllipse

上一页返回章节概述下一页

描述

 

画椭圆.

 

C++ Syntax

 

Status DrawEllipse(

[in]  const Pen *pen,

[in]  REAL x,

[in]  REAL y,

[in]  REAL width,

[in]  REAL height

);

 

Status DrawEllipse(

[in]  const Pen *pen,

[in]  INT x,

[in]  INT y,

[in]  INT width,

[in]  INT height

);

 

Status DrawEllipse(

[in]       const Pen *pen,

[in, ref]  const RectF &rect

);

 

Status DrawEllipse(

[in]       const Pen *pen,

[in, ref]  const Rect &rect

);

 

FreeBASIC 语法

 

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

 

参数

 

pPen

 

[in]指针的那一支钢笔是用来绘制椭圆.

 

x

 

[in]单精度数指定矩形左上角的x坐标,椭圆的边界.

 

y

 

[in]单精度数,指定矩形左上角的坐标范围的椭圆.

 

nWidth

 

[in]单精度数指定矩形的宽度范围的椭圆.

 

nHeight

 

[in]简单精度数指定矩形的高度填充的椭圆.

 

返回值

 

如果该方法成功,则返回Ok,这是对Status枚举元素.

如果这个方法失败,它返回一个枚举的其他元素的Status.

 

引用文件

 

CGpBitmap.inc (include CGdiPlus.inc)

 

示例

 

' ========================================================================================

' 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(GDIP_ARGB(255, 0, 0, 255), 3)

  graphics.DrawEllipse(@bluePen, 100.0, 70.0, 200.0, 100.0)

 

END SUB

' ========================================================================================