GraphicsPath::AddEllipse (constRectF&) 方法 (gdipluspath.h)

GraphicsPath::AddEllipse 方法将省略号添加到此路径。

语法

Status AddEllipse(
  const RectF & rect
);

参数

rect

对限定椭圆的矩形的引用。

返回值

类型:状态

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

如果方法失败,它将返回 Status 枚举的其他元素之一。

注解

GraphicsPath 对象将椭圆存储为由四个连接的 Bézier 样条构成的序列。 GraphicsPath 对象不存储椭圆边框的左上角、宽度和高度。

示例

以下示例创建 一个 GraphicsPath 对象路径,向 path 添加一个椭圆,然后绘制路径。

VOID Example_AddEllipse(HDC hdc)
{
   Graphics graphics(hdc); 
   RectF rect(20.0f, 20.0f, 200.0f, 100.0f);

   GraphicsPath path;
   path.AddEllipse(rect);

   // Draw the path.
   Pen pen(Color(255, 255, 0, 0));
   graphics.DrawPath(&pen, &path);
}

要求

   
标头 gdipluspath.h

另请参阅

AddArc 方法

AddEllipse 方法

使用区域进行剪裁

构造并绘制轨迹

创建路径渐变

椭圆和弧

GraphicsPath

路径

RectF