Graphics::D rawArc (constPen*,REAL,REAL,REAL,REAL,REAL,REAL,REAL) 方法 (gdiplusgraphics.h)

Graphics::D rawArc 方法绘制一个弧线。弧线是椭圆的一部分。

语法

Status DrawArc(
  const Pen *pen,
  REAL      x,
  REAL      y,
  REAL      width,
  REAL      height,
  REAL      startAngle,
  REAL      sweepAngle
);

parameters

pen

指向用于绘制弧线的笔的指针。

x

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

y

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

width

实数,指定包含弧线的椭圆的宽度。

height

实数,指定包含弧线的椭圆的高度。

startAngle

指定 x 轴与弧线起点之间的角度的实数。

sweepAngle

实数,指定弧线的起始点和终点之间的角度。

返回值

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

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

注解

示例

以下示例绘制一个 90 度的弧线。

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

   // Set up the arc.
   Pen redPen(Color(255, 255, 0, 0), 3);
   REAL x = 0;
   REAL y = 0;
   REAL width = 200.0f;
   REAL height = 100.0f;
   REAL startAngle = 0.0f;
   REAL sweepAngle = 90.0f;

   // Draw the arc.
   graphics.DrawArc(&redPen, x, y, width, height, startAngle, sweepAngle);
}

要求

   
标头 gdiplusgraphics.h

另请参阅

从线条、曲线和形状创建图形

DrawArc 方法

DrawEllipse 方法

椭圆和弧

显卡

Rect