Region.Intersect 메서드

정의

지정된과의 교집합으로 업데이트 Region 합니다 Region.

오버로드

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

이것 GraphicsPathRegion과 교차할 수 있습니다.

예제

코드 예제는 및 RectangleF.Intersect(RectangleF) 메서드를 Complement(GraphicsPath) 참조하세요.

적용 대상

Intersect(Rectangle)

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

RectangleRegion구조와 교차할 구조입니다.

예제

코드 예제는 메서드를 참조하세요 Intersect(RectangleF) .

적용 대상

Intersect(RectangleF)

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

RectangleFRegion구조와 교차할 구조입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.

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

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

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

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

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

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

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

이것 RegionRegion과 교차할 수 있습니다.

예제

코드 예제는 및 Intersect(RectangleF) 메서드를 Complement(GraphicsPath) 참조하세요..

적용 대상