다음을 통해 공유


Graphics.ExcludeClip 메서드

정의

구조체로 지정된 Rectangle 영역을 제외하도록 이 Graphics 클립 영역을 업데이트합니다.

오버로드

Name Description
ExcludeClip(Region)

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

ExcludeClip(Rectangle)

구조체로 지정된 Rectangle 영역을 제외하도록 이 Graphics 클립 영역을 업데이트합니다.

ExcludeClip(Region)

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

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

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

구조체로 지정된 Rectangle 영역을 제외하도록 이 Graphics 클립 영역을 업데이트합니다.

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 할당합니다.

적용 대상