Region.Intersect 메서드

정의

Region을 지정된 Region의 교차 부분으로 업데이트합니다.

오버로드

Intersect(GraphicsPath)

Region을 지정된 GraphicsPath의 교차 부분으로 업데이트합니다.

Intersect(Rectangle)

Region을 지정된 Rectangle 구조의 교차 부분으로 업데이트합니다.

Intersect(RectangleF)

Region을 지정된 RectangleF 구조의 교차 부분으로 업데이트합니다.

Intersect(Region)

Region을 지정된 Region의 교차 부분으로 업데이트합니다.

Intersect(GraphicsPath)

Source:
Region.cs
Source:
Region.cs
Source:
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)

Source:
Region.cs
Source:
Region.cs
Source:
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)

Source:
Region.cs
Source:
Region.cs
Source:
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 Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 첫 번째 사각형을 만들고 검은색으로 화면에 그립니다.

  • 두 번째 사각형을 만들고 빨간색으로 화면에 그립니다.

  • 첫 번째 사각형에서 영역을 만듭니다.

  • 두 번째 사각형과 결합된 경우 영역의 교집합 영역을 가져옵니다.

  • 교집합 영역을 파란색으로 채우고 화면에 그립니다.

영역과 사각형의 겹치는 영역만 파란색입니다.

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)

Source:
Region.cs
Source:
Region.cs
Source:
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) 참조하세요..

적용 대상