4 つの Point 構造体で定義されるベジエ スプラインを描画します。
オーバーロードの一覧
4 つの Point 構造体で定義されるベジエ スプラインを描画します。
[Visual Basic] Overloads Public Sub DrawBezier(Pen, Point, Point, Point, Point)
[C#] public void DrawBezier(Pen, Point, Point, Point, Point);
[C++] public: void DrawBezier(Pen*, Point, Point, Point, Point);
[JScript] public function DrawBezier(Pen, Point, Point, Point, Point);
4 つの PointF 構造体で定義されるベジエ スプラインを描画します。
[Visual Basic] Overloads Public Sub DrawBezier(Pen, PointF, PointF, PointF, PointF)
[C#] public void DrawBezier(Pen, PointF, PointF, PointF, PointF);
[C++] public: void DrawBezier(Pen*, PointF, PointF, PointF, PointF);
[JScript] public function DrawBezier(Pen, PointF, PointF, PointF, PointF);
各点を表す 4 つの順序付けられた座標ペアで定義されるベジエ スプラインを描画します。
[Visual Basic] Overloads Public Sub DrawBezier(Pen, Single, Single, Single, Single, Single, Single, Single, Single)
[C#] public void DrawBezier(Pen, float, float, float, float, float, float, float, float);
[C++] public: void DrawBezier(Pen*, float, float, float, float, float, float, float, float);
[JScript] public function DrawBezier(Pen, float, float, float, float, float, float, float, float);
使用例
[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 Paint イベント ハンドラのパラメータである PaintEventArgs e が必要です。このコードは次のアクションを実行します。
- 黒いペンを作成します。
- 曲線の開始点、終了点、および 2 つの制御点の座標を作成します。
- 画面にベジエ曲線を描画します。
[Visual Basic, C#] メモ ここでは、DrawBezier のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。
' Begin Example03.
Public Sub DrawBezierFloat(e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create coordinates of points for curve.
Dim startX As Single = 100F
Dim startY As Single = 100F
Dim controlX1 As Single = 200F
Dim controlY1 As Single = 10F
Dim controlX2 As Single = 350F
Dim controlY2 As Single = 50F
Dim endX As Single = 500F
Dim endY As Single = 100F
' Draw arc to screen.
e.Graphics.DrawBezier(blackPen, startX, startY, controlX1, _
controlY1, controlX2, controlY2, endX, endY)
End Sub
[C#]
public void DrawBezierFloat(PaintEventArgs e)
{
// Create pen.
Pen blackPen = new Pen(Color.Black, 3);
// Create coordinates of points for curve.
float startX = 100.0F;
float startY = 100.0F;
float controlX1 = 200.0F;
float controlY1 = 10.0F;
float controlX2 = 350.0F;
float controlY2 = 50.0F;
float endX = 500.0F;
float endY = 100.0F;
// Draw arc to screen.
e.Graphics.DrawBezier(blackPen, startX, startY,
controlX1, controlY1,
controlX2, controlY2,
endX, endY);
}
[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。