Graphics.ExcludeClip 메서드

정의

Graphics의 클립 영역을 업데이트하여 Rectangle 구조체에 의해 지정된 영역을 제외합니다.

오버로드

ExcludeClip(Region)

Graphics의 클립 영역을 업데이트하여 Region에 의해 지정된 영역을 제외합니다.

ExcludeClip(Rectangle)

Graphics의 클립 영역을 업데이트하여 Rectangle 구조체에 의해 지정된 영역을 제외합니다.

ExcludeClip(Region)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Graphics의 클립 영역을 업데이트하여 Region에 의해 지정된 영역을 제외합니다.

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 Forms 사용하도록 설계되었으며 이벤트 처리기의 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)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
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 Forms 사용하도록 설계되었으며 이벤트 처리기의 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 할당합니다.

적용 대상