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



次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
-
左上隅が (100, 100) に位置する 2 つ目の四角形を作成し、この四角形と現在のクリッピング領域 (最初の四角形) との交差部分にクリッピング領域を設定します。
-
2 つのクリッピング領域の周りに四角形を描画します。最初のクリッピング四角形には黒いペンを、2 つ目のクリッピング領域には赤いペンを使用します。
Public Sub IntersectClipRectangleF2(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 IntersectClipRectangleF2(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 CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

- Graphics.ResetClip メソッドのページへのリンク