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


このメソッドは、パスの部分を区切るために使用するマーカーをパスに作成します。NextMarker メソッドを使用すると、パス内でマーカーを反復できます。
マーカーは、サブパスのグループを区切るために使用されます。パスの 2 つのマーカー間には、1 つ以上のサブパスを含めることができます。

次のコード例は、Windows フォームでの使用を意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコードはパスを作成し、そのパスに複数のプリミティブをマーカーで区切りながら追加して、パスを画面に描画します。
Public Sub SetMarkersExample(ByVal e As PaintEventArgs) ' Create a path and set two markers. Dim myPath As New GraphicsPath myPath.AddLine(New Point(0, 0), New Point(50, 50)) myPath.SetMarkers() Dim rect As New Rectangle(50, 50, 50, 50) myPath.AddRectangle(rect) myPath.SetMarkers() myPath.AddEllipse(100, 100, 100, 50) ' Draw the path to screen. e.Graphics.DrawPath(New Pen(Color.Black, 2), myPath) End Sub
private void SetMarkersExample(PaintEventArgs e) { // Create a path and set two markers. GraphicsPath myPath = new GraphicsPath(); myPath.AddLine(new Point(0, 0), new Point(50, 50)); myPath.SetMarkers(); Rectangle rect = new Rectangle(50, 50, 50, 50); myPath.AddRectangle(rect); myPath.SetMarkers(); myPath.AddEllipse(100, 100, 100, 50); // Draw the path to screen. e.Graphics.DrawPath(new Pen(Color.Black, 2), myPath); }
private: void SetMarkersExample( PaintEventArgs^ e ) { // Create a path and set two markers. GraphicsPath^ myPath = gcnew GraphicsPath; myPath->AddLine( Point(0,0), Point(50,50) ); myPath->SetMarkers(); Rectangle rect = Rectangle(50,50,50,50); myPath->AddRectangle( rect ); myPath->SetMarkers(); myPath->AddEllipse( 100, 100, 100, 50 ); // Draw the path to screen. e->Graphics->DrawPath( gcnew Pen( Color::Black,2.0f ), myPath ); }
private void SetMarkersExample(PaintEventArgs e) { // Create a path and set two markers. GraphicsPath myPath = new GraphicsPath(); myPath.AddLine(new Point(0, 0), new Point(50, 50)); myPath.SetMarkers(); Rectangle rect = new Rectangle(50, 50, 50, 50); myPath.AddRectangle(rect); myPath.SetMarkers(); myPath.AddEllipse(100, 100, 100, 50); // Draw the path to screen. e.get_Graphics().DrawPath(new Pen(Color.get_Black(), 2), myPath); } //SetMarkersExample

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.SetMarkers メソッドを検索する場合は、下記のリンクをクリックしてください。

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