GraphicsPath::AddEllipse (REAL,REAL,REAL,REAL,REAL) 方法 (gdipluspath.h)

GraphicsPath::AddEllipse 方法将椭圆添加到此路径。

语法

Status AddEllipse(
  [in] REAL x,
  [in] REAL y,
  [in] REAL width,
  [in] REAL height
);

参数

[in] x

类型: REAL

实数,指定椭圆边框左上角的 x 坐标。

[in] y

类型: REAL

实数,指定椭圆边框左上角的 y 坐标。

[in] width

类型: REAL

指定椭圆边框的宽度的实数。

[in] height

类型: REAL

实数,指定椭圆的边框的高度。

返回值

类型: 状态

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

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

注解

GraphicsPath 对象将椭圆存储为四个连接的贝塞尔样条序列。 GraphicsPath 对象不存储椭圆边框的左上角、宽度和高度。

示例

以下示例创建 GraphicsPath 对象 路径,将椭圆添加到 path,然后绘制 路径

VOID Example_AddEllipse(HDC hdc)
{
   Graphics graphics(hdc); 

   GraphicsPath path;
   path.AddEllipse(20.0f, 20.0f, 200.0f, 100.0f);

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

要求

要求
最低受支持的客户端 Windows XP、Windows 2000 Professional [仅限桌面应用]
最低受支持的服务器 Windows 2000 Server [仅限桌面应用]
目标平台 Windows
标头 gdipluspath.h (包括 Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

另请参阅

AddArc 方法

AddEllipse 方法

使用区域进行剪裁

构造并绘制轨迹

创建路径渐变

椭圆和弧

GraphicsPath

路径