Graphics.IntersectClip メソッド (RectangleF)
アセンブリ: System.Drawing (system.drawing.dll 内)



次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
-
左上隅が (100, 100) に位置する 2 つ目の四角形を作成し、この四角形と現在のクリッピング領域 (最初の四角形) との交差部分にクリッピング領域を設定します。
-
2 つのクリッピング領域の周りに四角形を描画します。最初のクリッピング四角形には黒いペンを、2 つ目のクリッピング領域には赤いペンを使用します。
Public Sub IntersectClipRectangleF1(ByVal e As PaintEventArgs) ' Set clipping region. Dim clipRect As New Rectangle(0, 0, 200, 200) e.Graphics.SetClip(clipRect) ' Update clipping region to intersection of ' existing region with specified rectangle. Dim intersectRectF As New RectangleF(100.0F, 100.0F, 200.0F, 200.0F) e.Graphics.IntersectClip(intersectRectF) ' Fill rectangle to demonstrate effective clipping region. e.Graphics.FillRectangle(New SolidBrush(Color.Blue), 0, 0, _ 500, 500) ' Reset clipping region to infinite. e.Graphics.ResetClip() ' Draw clipRect and intersectRect to screen. e.Graphics.DrawRectangle(New Pen(Color.Black), clipRect) e.Graphics.DrawRectangle(New Pen(Color.Red), _ Rectangle.Round(intersectRectF)) End Sub
public void IntersectClipRectangleF1(PaintEventArgs e) { // Set clipping region. Rectangle clipRect = new Rectangle(0, 0, 200, 200); e.Graphics.SetClip(clipRect); // Update clipping region to intersection of // existing region with specified rectangle. RectangleF intersectRectF = new RectangleF(100.0F, 100.0F, 200.0F, 200.0F); e.Graphics.IntersectClip(intersectRectF); // Fill rectangle to demonstrate effective clipping region. e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 500, 500); // Reset clipping region to infinite. e.Graphics.ResetClip(); // Draw clipRect and intersectRect to screen. e.Graphics.DrawRectangle(new Pen(Color.Black), clipRect); e.Graphics.DrawRectangle(new Pen(Color.Red), Rectangle.Round(intersectRectF)); }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.IntersectClip メソッド (Region)
アセンブリ: System.Drawing (system.drawing.dll 内)



次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
-
領域を作成し、その領域を 2 つ目の四角形に設定し、Replace の組み合わせモードを使用して、その四角形と現在のクリッピング領域 (1 つ目の四角形) との交差部分にクリッピング領域を設定します。
-
2 つのクリッピング領域の周りに四角形を描画します。最初のクリッピング領域には黒いペンを、2 つ目のクリッピング領域には赤いペンを使用します。
Public Sub IntersectClipRegion(ByVal e As PaintEventArgs) ' Set clipping region. Dim clipRect As New Rectangle(0, 0, 200, 200) Dim clipRegion As New [Region](clipRect) e.Graphics.SetClip(clipRegion, CombineMode.Replace) ' Update clipping region to intersection of ' existing region with specified rectangle. Dim intersectRect As New Rectangle(100, 100, 200, 200) Dim intersectRegion As New [Region](intersectRect) e.Graphics.IntersectClip(intersectRegion) ' Fill rectangle to demonstrate effective clipping region. e.Graphics.FillRectangle(New SolidBrush(Color.Blue), 0, 0, _ 500, 500) ' Reset clipping region to infinite. e.Graphics.ResetClip() ' Draw clipRect and intersectRect to screen. e.Graphics.DrawRectangle(New Pen(Color.Black), clipRect) e.Graphics.DrawRectangle(New Pen(Color.Red), intersectRect) End Sub
public void IntersectClipRegion(PaintEventArgs e) { // Set clipping region. Rectangle clipRect = new Rectangle(0, 0, 200, 200); Region clipRegion = new Region(clipRect); e.Graphics.SetClip(clipRegion, CombineMode.Replace); // Update clipping region to intersection of // existing region with specified rectangle. Rectangle intersectRect = new Rectangle(100, 100, 200, 200); Region intersectRegion = new Region(intersectRect); e.Graphics.IntersectClip(intersectRegion); // Fill rectangle to demonstrate effective clipping region. e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 500, 500); // Reset clipping region to infinite. e.Graphics.ResetClip(); // Draw clipRect and intersectRect to screen. e.Graphics.DrawRectangle(new Pen(Color.Black), clipRect); e.Graphics.DrawRectangle(new Pen(Color.Red), intersectRect); }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.IntersectClip メソッド (Rectangle)
アセンブリ: System.Drawing (system.drawing.dll 内)



次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
-
左上隅が (100, 100) に位置する 2 つ目の四角形を作成し、この四角形と現在のクリッピング領域 (最初の四角形) との交差部分にクリッピング領域を設定します。
-
2 つのクリッピング領域の周りに四角形を描画します。最初のクリッピング四角形には黒いペンを、2 つ目のクリッピング領域には赤いペンを使用します。
Public Sub IntersectClipRectangle(ByVal e As PaintEventArgs) ' Set clipping region. Dim clipRect As New Rectangle(0, 0, 200, 200) e.Graphics.SetClip(clipRect) ' Update clipping region to intersection of ' existing region with specified rectangle. Dim intersectRect As New Rectangle(100, 100, 200, 200) e.Graphics.IntersectClip(intersectRect) ' Fill rectangle to demonstrate effective clipping region. e.Graphics.FillRectangle(New SolidBrush(Color.Blue), 0, 0, _ 500, 500) ' Reset clipping region to infinite. e.Graphics.ResetClip() ' Draw clipRect and intersectRect to screen. e.Graphics.DrawRectangle(New Pen(Color.Black), clipRect) e.Graphics.DrawRectangle(New Pen(Color.Red), intersectRect) End Sub
public void IntersectClipRectangle(PaintEventArgs e) { // Set clipping region. Rectangle clipRect = new Rectangle(0, 0, 200, 200); e.Graphics.SetClip(clipRect); // Update clipping region to intersection of // existing region with specified rectangle. Rectangle intersectRect = new Rectangle(100, 100, 200, 200); e.Graphics.IntersectClip(intersectRect); // Fill rectangle to demonstrate effective clipping region. e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 500, 500); // Reset clipping region to infinite. e.Graphics.ResetClip(); // Draw clipRect and intersectRect to screen. e.Graphics.DrawRectangle(new Pen(Color.Black), clipRect); e.Graphics.DrawRectangle(new Pen(Color.Red), intersectRect); }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.IntersectClip メソッド

名前 | 説明 |
---|---|
Graphics.IntersectClip (Rectangle) | この Graphics のクリップ領域を現在のクリップ領域と指定した Rectangle 構造体との交差部分に更新します。 |
Graphics.IntersectClip (RectangleF) | この Graphics のクリップ領域を現在のクリップ領域と指定した RectangleF 構造体との交差部分に更新します。 |
Graphics.IntersectClip (Region) | この Graphics のクリップ領域を現在のクリップ領域と指定した Region との交差部分に更新します。 |

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

- Graphics.IntersectClipのページへのリンク