Graphics.ExcludeClip メソッド

定義

Graphics 構造体で指定された領域が除外されるように、この Rectangle のクリップ領域を更新します。

オーバーロード

ExcludeClip(Region)

Region で指定された領域が除外されるように、この Graphics のクリップ領域を更新します。

ExcludeClip(Rectangle)

Graphics 構造体で指定された領域が除外されるように、この Rectangle のクリップ領域を更新します。

ExcludeClip(Region)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

Region で指定された領域が除外されるように、この Graphics のクリップ領域を更新します。

public:
 void ExcludeClip(System::Drawing::Region ^ region);
public void ExcludeClip (System.Drawing.Region region);
member this.ExcludeClip : System.Drawing.Region -> unit
Public Sub ExcludeClip (region As Region)

パラメーター

region
Region

クリップ領域から除外する領域を指定する Region

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

  • 左上隅が座標 (100、100) にある 100 ピクセル x 100 ピクセルの四角形を作成します。

  • 四角形を除外するクリッピング領域を設定します。

  • 左上隅が座標 (0, 0) にある 300 ピクセル x 300 ピクセルの四角形を、単色の青いブラシで塗りつぶします。

結果として、右下隅に四角形が見つからない青い四角形が表示されます。

public:
   void ExcludeClipRegion( PaintEventArgs^ e )
   {
      // Create rectangle for region.
      Rectangle excludeRect = Rectangle(100,100,200,200);

      // Create region for exclusion.
      System::Drawing::Region^ excludeRegion = gcnew System::Drawing::Region( excludeRect );

      // Set clipping region to exclude region.
      e->Graphics->ExcludeClip( excludeRegion );

      // Fill large rectangle to show clipping region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Blue ), 0, 0, 300, 300 );
   }
public void ExcludeClipRegion(PaintEventArgs e)
{
             
    // Create rectangle for region.
    Rectangle excludeRect = new Rectangle(100, 100, 200, 200);
             
    // Create region for exclusion.
    Region excludeRegion = new Region(excludeRect);
             
    // Set clipping region to exclude region.
    e.Graphics.ExcludeClip(excludeRegion);
             
    // Fill large rectangle to show clipping region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 300, 300);
}
Public Sub ExcludeClipRegion(ByVal e As PaintEventArgs)

    ' Create rectangle for region.
    Dim excludeRect As New Rectangle(100, 100, 200, 200)

    ' Create region for exclusion.
    Dim excludeRegion As New [Region](excludeRect)

    ' Set clipping region to exclude region.
    e.Graphics.ExcludeClip(excludeRegion)

    ' Fill large rectangle to show clipping region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Blue), 0, 0, _
    300, 300)
End Sub

注釈

このメソッドは、 パラメーターで指定された領域をregion現在のクリップ領域から除外し、結果の領域をこの Graphicsの プロパティにClip割り当てます。

適用対象

ExcludeClip(Rectangle)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

Graphics 構造体で指定された領域が除外されるように、この Rectangle のクリップ領域を更新します。

public:
 void ExcludeClip(System::Drawing::Rectangle rect);
public void ExcludeClip (System.Drawing.Rectangle rect);
member this.ExcludeClip : System.Drawing.Rectangle -> unit
Public Sub ExcludeClip (rect As Rectangle)

パラメーター

rect
Rectangle

クリップ領域から除外する四角形を指定する Rectangle 構造体。

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

  • 左上隅が座標 (100、100) にある 100 ピクセル x 100 ピクセルの四角形を作成します。

  • 四角形で定義された領域を作成します。

  • 四角形領域を除外するクリッピング領域を設定します。

  • 左上隅が座標 (0, 0) にある 300 ピクセル x 300 ピクセルの四角形を、単色の青いブラシで塗りつぶします。

結果は、右下隅に向かって四角形の領域が見つからない青い四角形になります。

public:
   void ExcludeClipRectangle( PaintEventArgs^ e )
   {
      // Create rectangle for exclusion.
      Rectangle excludeRect = Rectangle(100,100,200,200);

      // Set clipping region to exclude rectangle.
      e->Graphics->ExcludeClip( excludeRect );

      // Fill large rectangle to show clipping region.
      e->Graphics->FillRectangle( gcnew SolidBrush( Color::Blue ), 0, 0, 300, 300 );
   }
public void ExcludeClipRectangle(PaintEventArgs e)
{
             
    // Create rectangle for exclusion.
    Rectangle excludeRect = new Rectangle(100, 100, 200, 200);
             
    // Set clipping region to exclude rectangle.
    e.Graphics.ExcludeClip(excludeRect);
             
    // Fill large rectangle to show clipping region.
    e.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 300, 300);
}
Public Sub ExcludeClipRectangle(ByVal e As PaintEventArgs)

    ' Create rectangle for exclusion.
    Dim excludeRect As New Rectangle(100, 100, 200, 200)

    ' Set clipping region to exclude rectangle.
    e.Graphics.ExcludeClip(excludeRect)

    ' Fill large rectangle to show clipping region.
    e.Graphics.FillRectangle(New SolidBrush(Color.Blue), 0, 0, _
    300, 300)
End Sub

注釈

このメソッドは、 パラメーターで指定された領域をrect現在のクリップ領域から除外し、結果の領域をこの Graphicsの プロパティにClip割り当てます。

適用対象