Region 생성자

정의

Region를 초기화합니다.

오버로드

Region()

Region를 초기화합니다.

Region(GraphicsPath)

지정된 GraphicsPath을 사용하여 새 Region를 초기화합니다.

Region(RegionData)

지정된 데이터에서 새 Region을 초기화합니다.

Region(Rectangle)

지정된 Region 구조체에서 새 Rectangle을 초기화합니다.

Region(RectangleF)

지정된 Region 구조체에서 새 RectangleF을 초기화합니다.

Region()

Region를 초기화합니다.

public:
 Region();
public Region ();
Public Sub New ()

설명

이 생성자는 무한 내부를 사용하여 새 Region 를 초기화합니다.

적용 대상

Region(GraphicsPath)

지정된 GraphicsPath을 사용하여 새 Region를 초기화합니다.

public:
 Region(System::Drawing::Drawing2D::GraphicsPath ^ path);
public Region (System.Drawing.Drawing2D.GraphicsPath path);
new System.Drawing.Region : System.Drawing.Drawing2D.GraphicsPath -> System.Drawing.Region
Public Sub New (path As GraphicsPath)

매개 변수

path
GraphicsPath

Region을 정의하는 GraphicsPath입니다.

예외

pathnull입니다.

설명

이 메서드는 를 사용하여 새 RegionGraphicsPath만듭니다. 새 영역은 매개 변수에 지정된 pathGraphicsPath 내부로 정의됩니다.

적용 대상

Region(RegionData)

지정된 데이터에서 새 Region을 초기화합니다.

public:
 Region(System::Drawing::Drawing2D::RegionData ^ rgnData);
public Region (System.Drawing.Drawing2D.RegionData rgnData);
new System.Drawing.Region : System.Drawing.Drawing2D.RegionData -> System.Drawing.Region
Public Sub New (rgnData As RegionData)

매개 변수

rgnData
RegionData

Region의 내부를 정의하는 RegionData입니다.

예외

rgnData이(가) null인 경우

설명

이 메서드는 기존 Region에 의해 정의된 내부를 사용하여 새 Region 를 만듭니다. rgnData 매개 변수는 기존 Region의 정의를 포함하는 배열입니다.

적용 대상

Region(Rectangle)

지정된 Region 구조체에서 새 Rectangle을 초기화합니다.

public:
 Region(System::Drawing::Rectangle rect);
public Region (System.Drawing.Rectangle rect);
new System.Drawing.Region : System.Drawing.Rectangle -> System.Drawing.Region
Public Sub New (rect As Rectangle)

매개 변수

rect
Rectangle

Rectangle의 내부를 정의하는 Region 구조체입니다.

예제

다음 코드 예제를 사용 Region 하는 방법에 설명 합니다 생성자 및 MakeEmpty 메서드. 이 예제는 Windows Forms 함께 사용하도록 설계되었습니다. 양식을 만들고 다음 코드를 붙여넣습니다. FillEmptyRegion 형식의 Paint 이벤트 처리 메서드에서 메서드를 호출하고 를 로 PaintEventArgs전달 e 합니다.

private:
   void FillEmptyRegion( PaintEventArgs^ e )
   {
      // Create a region from a rectangle.
      Rectangle originalRectangle = Rectangle(40,40,40,50);
      System::Drawing::Region^ smallRegion = gcnew System::Drawing::Region( originalRectangle );

      // Call MakeEmpty.
      smallRegion->MakeEmpty();

      // Fill the region in red and draw the original rectangle
      // in black. Note there is nothing filled in.
      e->Graphics->FillRegion( Brushes::Red, smallRegion );
      e->Graphics->DrawRectangle( Pens::Black, originalRectangle );
   }
private void FillEmptyRegion(PaintEventArgs e)
{

    // Create a region from a rectangle.
    Rectangle originalRectangle = new Rectangle(40, 40, 40, 50);
    Region smallRegion = new Region(originalRectangle);

    // Call MakeEmpty.
    smallRegion.MakeEmpty();

    // Fill the region in red and draw the original rectangle
    // in black. Note there is nothing filled in.
    e.Graphics.FillRegion(Brushes.Red, smallRegion);
    e.Graphics.DrawRectangle(Pens.Black, originalRectangle);
}
Private Sub FillEmptyRegion(ByVal e As PaintEventArgs)

    ' Create a region from a rectangle.
    Dim originalRectangle As New Rectangle(40, 40, 40, 50)
    Dim smallRegion As New Region(originalRectangle)

    ' Call MakeEmpty.
    smallRegion.MakeEmpty()

    ' Fill the region in red and draw the original rectangle
    ' in black. Note there is nothing filled in.
    e.Graphics.FillRegion(Brushes.Red, smallRegion)
    e.Graphics.DrawRectangle(Pens.Black, originalRectangle)

End Sub

설명

이 메서드는 사각형 내부를 사용하여 새 Region 를 만듭니다. 내부는 매개 변수로 정의됩니다 rect .

적용 대상

Region(RectangleF)

지정된 Region 구조체에서 새 RectangleF을 초기화합니다.

public:
 Region(System::Drawing::RectangleF rect);
public Region (System.Drawing.RectangleF rect);
new System.Drawing.Region : System.Drawing.RectangleF -> System.Drawing.Region
Public Sub New (rect As RectangleF)

매개 변수

rect
RectangleF

RectangleF의 내부를 정의하는 Region 구조체입니다.

설명

이 메서드는 사각형 내부를 사용하여 새 Region 를 만듭니다. 내부는 매개 변수로 정의됩니다 rect .

적용 대상