GraphicsPath.CloseFigure メソッド
アセンブリ: System.Drawing (system.drawing.dll 内)


次のコード例は、Windows フォームでの使用を意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコードは、新しいパスを作成して図形を開始し、その図形に交差する 2 本の直線を追加してから図形を閉じて三角形を形成することで、三角形を作成します。次に、パスが画面に描画されます。
Public Sub CloseFigureExample(ByVal e As PaintEventArgs) ' Create a path consisting of two, open-ended lines and close ' the lines using CloseFigure. Dim myPath As New GraphicsPath myPath.StartFigure() myPath.AddLine(New Point(10, 10), New Point(200, 10)) myPath.AddLine(New Point(200, 10), New Point(200, 200)) myPath.CloseFigure() ' Draw the path to the screen. e.Graphics.DrawPath(Pens.Black, myPath) End Sub
private void CloseFigureExample(PaintEventArgs e) { // Create a path consisting of two, open-ended lines and close // the lines using CloseFigure. GraphicsPath myPath = new GraphicsPath(); myPath.StartFigure(); myPath.AddLine(new Point(10, 10), new Point(200, 10)); myPath.AddLine(new Point(200, 10), new Point(200, 200)); myPath.CloseFigure(); // Draw the path to the screen. e.Graphics.DrawPath(Pens.Black, myPath); }
private: void CloseFigureExample( PaintEventArgs^ e ) { // Create a path consisting of two, open-ended lines and close // the lines using CloseFigure. GraphicsPath^ myPath = gcnew GraphicsPath; myPath->StartFigure(); myPath->AddLine( Point(10,10), Point(200,10) ); myPath->AddLine( Point(200,10), Point(200,200) ); myPath->CloseFigure(); // Draw the path to the screen. e->Graphics->DrawPath( Pens::Black, myPath ); }
private void CloseFigureExample(PaintEventArgs e) { // Create a path consisting of two, open-ended lines and close // the lines using CloseFigure. GraphicsPath myPath = new GraphicsPath(); myPath.StartFigure(); myPath.AddLine(new Point(10, 10), new Point(200, 10)); myPath.AddLine(new Point(200, 10), new Point(200, 200)); myPath.CloseFigure(); // Draw the path to the screen. e.get_Graphics().DrawPath(Pens.get_Black(), myPath); } //CloseFigureExample

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からGraphicsPath.CloseFigure メソッドを検索する場合は、下記のリンクをクリックしてください。

- GraphicsPath.CloseFigure メソッドのページへのリンク