GraphicsPath::AddArc (constRectF&,REAL,REAL) 方法 (gdipluspath.h)
GraphicsPath::AddArc 方法将椭圆弧添加到此路径的当前图中。
语法
Status AddArc(
const RectF & rect,
REAL startAngle,
REAL sweepAngle
);
参数
rect
对边框的引用,该矩形绑定包含弧线的椭圆。
startAngle
实数,指定椭圆的水平轴与弧线起点之间的顺时针角度(以度为单位)。
sweepAngle
实数,指定起点 (startAngle) 与弧线终点之间的顺时针角度(以度为单位)。
返回值
Type:Status
如果方法成功,则返回 Ok,这是 Status 枚举的元素。
如果 方法失败,它将返回 Status 枚举的其他元素之一。
注解
示例
以下示例创建 GraphicsPath 对象 路径,向 path 添加一个弧线,关闭弧线,然后绘制 路径。
VOID AddArcExample(HDC hdc)
{
Graphics graphics(hdc);
RectF rect(20.0f, 20.0f, 50.0f, 100.0f);
GraphicsPath path;
path.AddArc(rect, 0.0f, 180.0f);
path.CloseFigure();
// Draw the path.
Pen pen(Color(255, 255, 0, 0));
graphics.DrawPath(&pen, &path);
}
要求
要求 | 值 |
---|---|
Header | gdipluspath.h |
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈