Graphics.IntersectClipとは? わかりやすく解説

Graphics.IntersectClip メソッド (RectangleF)

この Graphicsクリップ領域現在のクリップ領域指定した RectangleF 構造体との交差部分更新します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub IntersectClip ( _
    rect As RectangleF _
)
Dim instance As Graphics
Dim rect As RectangleF

instance.IntersectClip(rect)
public void IntersectClip (
    RectangleF rect
)
public:
void IntersectClip (
    RectangleF rect
)
public void IntersectClip (
    RectangleF rect
)
public function IntersectClip (
    rect : RectangleF
)

パラメータ

rect

現在のクリップ領域交差する RectangleF 構造体

解説解説
使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

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));
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IntersectClip メソッド (Region)

この Graphicsクリップ領域現在のクリップ領域指定した Region との交差部分更新します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub IntersectClip ( _
    region As Region _
)
public void IntersectClip (
    Region region
)
public:
void IntersectClip (
    Region^ region
)
public void IntersectClip (
    Region region
)
public function IntersectClip (
    region : Region
)

パラメータ

region

現在の領域交差する Region

解説解説
使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IntersectClip メソッド (Rectangle)

この Graphicsクリップ領域現在のクリップ領域指定した Rectangle 構造体との交差部分更新します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub IntersectClip ( _
    rect As Rectangle _
)
Dim instance As Graphics
Dim rect As Rectangle

instance.IntersectClip(rect)
public void IntersectClip (
    Rectangle rect
)
public:
void IntersectClip (
    Rectangle rect
)
public void IntersectClip (
    Rectangle rect
)
public function IntersectClip (
    rect : Rectangle
)

パラメータ

rect

現在のクリップ領域交差する Rectangle 構造体

解説解説
使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

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);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IntersectClip メソッド



このページでは「.NET Framework クラス ライブラリ リファレンス」からGraphics.IntersectClipを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGraphics.IntersectClipを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGraphics.IntersectClip を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Graphics.IntersectClip」の関連用語

Graphics.IntersectClipのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Graphics.IntersectClipのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS