Region.Intersect メソッド

定義

この Region をそれ自体と指定の Region の交差部分に更新します。

オーバーロード

Intersect(GraphicsPath)

この Region をそれ自体と指定の GraphicsPath の交差部分に更新します。

Intersect(Rectangle)

この Region をそれ自体と指定の Rectangle 構造体の交差部分に更新します。

Intersect(RectangleF)

この Region をそれ自体と指定の RectangleF 構造体の交差部分に更新します。

Intersect(Region)

この Region をそれ自体と指定の Region の交差部分に更新します。

Intersect(GraphicsPath)

ソース:
Region.cs
ソース:
Region.cs
ソース:
Region.cs

この Region をそれ自体と指定の GraphicsPath の交差部分に更新します。

public:
 void Intersect(System::Drawing::Drawing2D::GraphicsPath ^ path);
public void Intersect (System.Drawing.Drawing2D.GraphicsPath path);
member this.Intersect : System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub Intersect (path As GraphicsPath)

パラメーター

path
GraphicsPath

この Region と交差する GraphicsPath

コード例については、 メソッドと Complement(GraphicsPath) メソッドをRectangleF.Intersect(RectangleF)参照してください。

適用対象

Intersect(Rectangle)

ソース:
Region.cs
ソース:
Region.cs
ソース:
Region.cs

この Region をそれ自体と指定の Rectangle 構造体の交差部分に更新します。

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

パラメーター

rect
Rectangle

この Region と交差する Rectangle 構造体。

コード例については、 メソッドを Intersect(RectangleF) 参照してください。

適用対象

Intersect(RectangleF)

ソース:
Region.cs
ソース:
Region.cs
ソース:
Region.cs

この Region をそれ自体と指定の RectangleF 構造体の交差部分に更新します。

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

パラメーター

rect
RectangleF

この Region と交差する RectangleF 構造体。

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

  • 最初の四角形を作成し、黒で画面に描画します。

  • 2 番目の四角形を作成し、赤で画面に描画します。

  • 最初の四角形から領域を作成します。

  • 2 番目の四角形と組み合わせた場合の領域の交差領域を取得します。

  • 交差領域を青で塗りつぶし、画面に描画します。

領域と四角形の重複する領域のみが青であることに注意してください。

public:
   void Intersect_RectF_Example( PaintEventArgs^ e )
   {
      // Create the first rectangle and draw it to the screen in black.
      Rectangle regionRect = Rectangle(20,20,100,100);
      e->Graphics->DrawRectangle( Pens::Black, regionRect );

      // create the second rectangle and draw it to the screen in red.
      RectangleF complementRect = RectangleF(90,30,100,100);
      e->Graphics->DrawRectangle( Pens::Red, Rectangle::Round( complementRect ) );

      // Create a region using the first rectangle.
      System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( regionRect );

      // Get the area of intersection for myRegion when combined with
      // complementRect.
      myRegion->Intersect( complementRect );

      // Fill the intersection area of myRegion with blue.
      SolidBrush^ myBrush = gcnew SolidBrush( Color::Blue );
      e->Graphics->FillRegion( myBrush, myRegion );
   }
public void Intersect_RectF_Example(PaintEventArgs e)
{
             
    // Create the first rectangle and draw it to the screen in black.
    Rectangle regionRect = new Rectangle(20, 20, 100, 100);
    e.Graphics.DrawRectangle(Pens.Black, regionRect);
             
    // create the second rectangle and draw it to the screen in red.
    RectangleF complementRect = new RectangleF(90, 30, 100, 100);
    e.Graphics.DrawRectangle(Pens.Red,
        Rectangle.Round(complementRect));
             
    // Create a region using the first rectangle.
    Region myRegion = new Region(regionRect);
             
    // Get the area of intersection for myRegion when combined with
             
    // complementRect.
    myRegion.Intersect(complementRect);
             
    // Fill the intersection area of myRegion with blue.
    SolidBrush myBrush = new SolidBrush(Color.Blue);
    e.Graphics.FillRegion(myBrush, myRegion);
}
Public Sub Intersect_RectF_Example(ByVal e As PaintEventArgs)

    ' Create the first rectangle and draw it to the screen in black.
    Dim regionRect As New Rectangle(20, 20, 100, 100)
    e.Graphics.DrawRectangle(Pens.Black, regionRect)

    ' create the second rectangle and draw it to the screen in red.
    Dim complementRect As New RectangleF(90, 30, 100, 100)
    e.Graphics.DrawRectangle(Pens.Red, _
    Rectangle.Round(complementRect))

    ' Create a region using the first rectangle.
    Dim myRegion As New [Region](regionRect)

    ' Get the area of intersection for myRegion when combined with
    ' complementRect.
    myRegion.Intersect(complementRect)

    ' Fill the intersection area of myRegion with blue.
    Dim myBrush As New SolidBrush(Color.Blue)
    e.Graphics.FillRegion(myBrush, myRegion)
End Sub

適用対象

Intersect(Region)

ソース:
Region.cs
ソース:
Region.cs
ソース:
Region.cs

この Region をそれ自体と指定の Region の交差部分に更新します。

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

パラメーター

region
Region

この Region と交差する Region

コード例については、 メソッドと Complement(GraphicsPath) メソッドに関するページをIntersect(RectangleF)参照してください。.

適用対象