GraphicsPath.CloseAllFigures メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
このパスで開いているすべての図形を閉じ、新しい図形を開始します。 開いている各図形は、その終了点と開始点を直線で接続することで閉じられます。
public:
void CloseAllFigures();
public void CloseAllFigures ();
member this.CloseAllFigures : unit -> unit
Public Sub CloseAllFigures ()
例
次のコード例は、Windows フォームで使用するように設計されており、イベント オブジェクトがOnPaint必要PaintEventArgse
です。 コードは、次のアクションを実行します。
パスを作成します。
パスにいくつかの開いている図形を追加します。
パス内のすべての図形を閉じます。
画面へのパスを描画します。
private:
void CloseAllFiguresExample( PaintEventArgs^ e )
{
// Create a path containing several open-ended figures.
GraphicsPath^ myPath = gcnew GraphicsPath;
myPath->StartFigure();
myPath->AddLine( Point(10,10), Point(150,10) );
myPath->AddLine( Point(150,10), Point(10,150) );
myPath->StartFigure();
myPath->AddArc( 200, 200, 100, 100, 0, 90 );
myPath->StartFigure();
Point point1 = Point(300,300);
Point point2 = Point(400,325);
Point point3 = Point(400,375);
Point point4 = Point(300,400);
array<Point>^ points = {point1,point2,point3,point4};
myPath->AddCurve( points );
// Close all the figures.
myPath->CloseAllFigures();
// Draw the path to the screen.
e->Graphics->DrawPath( gcnew Pen( Color::Black,3.0f ), myPath );
}
private void CloseAllFiguresExample(PaintEventArgs e)
{
// Create a path containing several open-ended figures.
GraphicsPath myPath = new GraphicsPath();
myPath.StartFigure();
myPath.AddLine(new Point(10, 10), new Point(150, 10));
myPath.AddLine(new Point(150, 10), new Point(10, 150));
myPath.StartFigure();
myPath.AddArc(200, 200, 100, 100, 0, 90);
myPath.StartFigure();
Point point1 = new Point(300, 300);
Point point2 = new Point(400, 325);
Point point3 = new Point(400, 375);
Point point4 = new Point(300, 400);
Point[] points = {point1, point2, point3, point4};
myPath.AddCurve(points);
// Close all the figures.
myPath.CloseAllFigures();
// Draw the path to the screen.
e.Graphics.DrawPath(new Pen(Color.Black, 3), myPath);
}
Public Sub CloseAllFiguresExample(ByVal e As PaintEventArgs)
' Create a path containing several open-ended figures.
Dim myPath As New GraphicsPath
myPath.StartFigure()
myPath.AddLine(New Point(10, 10), New Point(150, 10))
myPath.AddLine(New Point(150, 10), New Point(10, 150))
myPath.StartFigure()
myPath.AddArc(200, 200, 100, 100, 0, 90)
myPath.StartFigure()
Dim point1 As New Point(300, 300)
Dim point2 As New Point(400, 325)
Dim point3 As New Point(400, 375)
Dim point4 As New Point(300, 400)
Dim points As Point() = {point1, point2, point3, point4}
myPath.AddCurve(points)
' close all the figures.
myPath.CloseAllFigures()
' Draw the path to the screen.
e.Graphics.DrawPath(New Pen(Color.Black, 3), myPath)
End Sub
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示