GraphicsPath::AddBezier (constPointF&,constPointF&,constPointF&,constPointF&) 方法 (gdipluspath.h)
GraphicsPath::AddBezier 方法會將 Bézier 曲線新增至此路徑的目前圖形。
語法
Status AddBezier(
const PointF & pt1,
const PointF & pt2,
const PointF & pt3,
const PointF & pt4
);
參數
pt1
要啟動 Bézier 曲線的點參考。
pt2
Bézier 曲線第一個控制點的參考。
pt3
Bézier 曲線第二個控制點的參考。
pt4
指向結束 Bézier 曲線的點參考。
傳回值
Type:Status
如果方法成功,它會傳回Ok,這是 Status 列舉的元素。
如果方法失敗,它會傳回 Status 列舉的其他其中一個專案。
備註
範例
下列範例會建立 GraphicsPath 物件路徑、將 Bézier 曲線新增至路徑、關閉目前圖表 (此案例中唯一的圖形) ,然後繪製路徑。
VOID Example_AddBezier(HDC hdc)
{
Graphics graphics(hdc);
GraphicsPath path;
PointF pt1(50.0f, 50.0f);
PointF pt2(60.0f, 20.0f);
PointF pt3(70.0f, 100.0f);
PointF pt4(80.0f, 50.0f);
path.AddBezier(pt1, pt2, pt3, pt4);
path.CloseFigure();
// Draw the path.
Pen pen(Color(255, 255, 0, 0));
graphics.DrawPath(&pen, &path);
}
規格需求
標頭 | gdipluspath.h |
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應