Graphics.SetClip 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
오버로드
| Name | Description |
|---|---|
| SetClip(Region, CombineMode) |
이 Graphics 클리핑 영역을 현재 클립 영역과 Region지정된 클립 영역을 결합한 지정된 작업의 결과로 설정합니다. |
| SetClip(RectangleF, CombineMode) |
이 Graphics 영역의 클리핑 영역을 현재 클립 영역과 구조체로 지정된 RectangleF 사각형을 결합한 지정된 작업의 결과로 설정합니다. |
| SetClip(Rectangle, CombineMode) |
이 Graphics 영역의 클리핑 영역을 현재 클립 영역과 구조체로 지정된 Rectangle 사각형을 결합한 지정된 작업의 결과로 설정합니다. |
| SetClip(GraphicsPath, CombineMode) |
이 Graphics 클리핑 영역을 현재 클립 영역과 GraphicsPath지정된 클립 영역을 결합한 지정된 작업의 결과로 설정합니다. |
| SetClip(Graphics, CombineMode) |
이 Graphics 영역의 클리핑 영역을 현재 클립 영역의 지정된 결합 작업과 Clip 지정된 Graphics속성의 결과로 설정합니다. |
| SetClip(Rectangle) | |
| SetClip(Graphics) | |
| SetClip(GraphicsPath) |
이 Graphics 클리핑 영역을 지정된 GraphicsPath영역으로 설정합니다. |
| SetClip(RectangleF) |
이 Graphics 영역의 클리핑 영역을 구조체로 지정된 사각형으로 RectangleF 설정합니다. |
SetClip(Region, CombineMode)
public:
void SetClip(System::Drawing::Region ^ region, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip(System.Drawing.Region region, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.Region * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (region As Region, combineMode As CombineMode)
매개 변수
- combineMode
- CombineMode
CombineMode 사용할 결합 작업을 지정하는 열거형의 멤버입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
클리핑 영역에 대한 작은 사각형을 만듭니다.
멤버를 사용하여 클리핑 영역을 사각형으로 Replace 설정합니다.
큰 사각형을 단색 검정 브러시로 채웁니다.
그 결과 작고 채워진 검은색 사각형이 생성됩니다.
public:
void SetClipRegionCombine( PaintEventArgs^ e )
{
// Create region for clipping.
System::Drawing::Region^ clipRegion = gcnew System::Drawing::Region( Rectangle(0,0,100,100) );
// Set clipping region of graphics to region.
e->Graphics->SetClip( clipRegion, CombineMode::Replace );
// Fill rectangle to demonstrate clip region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
}
private void SetClipRegionCombine(PaintEventArgs e)
{
// Create region for clipping.
Region clipRegion = new Region(new Rectangle(0, 0, 100, 100));
// Set clipping region of graphics to region.
e.Graphics.SetClip(clipRegion, CombineMode.Replace);
// Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRegionCombine(ByVal e As PaintEventArgs)
' Create region for clipping.
Dim clipRegion As New [Region](New Rectangle(0, 0, 100, 100))
' Set clipping region of graphics to region.
e.Graphics.SetClip(clipRegion, CombineMode.Replace)
' Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub
적용 대상
SetClip(RectangleF, CombineMode)
이 Graphics 영역의 클리핑 영역을 현재 클립 영역과 구조체로 지정된 RectangleF 사각형을 결합한 지정된 작업의 결과로 설정합니다.
public:
void SetClip(System::Drawing::RectangleF rect, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip(System.Drawing.RectangleF rect, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.RectangleF * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (rect As RectangleF, combineMode As CombineMode)
매개 변수
- rect
- RectangleF
RectangleF 결합할 구조체입니다.
- combineMode
- CombineMode
사용할 결합 작업을 지정하는 열거형의 CombineMode 멤버입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
클리핑 영역에 대한 작은 사각형을 만듭니다.
멤버를 사용하여 클리핑 영역을 사각형으로 Replace 설정합니다.
큰 사각형을 단색 검정 브러시로 채웁니다.
그 결과 작고 채워진 검은색 사각형이 생성됩니다.
public:
void SetClipRectangleFCombine( PaintEventArgs^ e )
{
// Create rectangle for clipping region.
RectangleF clipRect = RectangleF(0.0F,0.0F,100.0F,100.0F);
// Set clipping region of graphics to rectangle.
e->Graphics->SetClip( clipRect, CombineMode::Replace );
// Fill rectangle to demonstrate clip region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
}
private void SetClipRectangleFCombine(PaintEventArgs e)
{
// Create rectangle for clipping region.
RectangleF clipRect = new RectangleF(0.0F, 0.0F, 100.0F, 100.0F);
// Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect, CombineMode.Replace);
// Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRectangleFCombine(ByVal e As PaintEventArgs)
' Create rectangle for clipping region.
Dim clipRect As New RectangleF(0.0F, 0.0F, 100.0F, 100.0F)
' Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect, CombineMode.Replace)
' Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub
적용 대상
SetClip(Rectangle, CombineMode)
public:
void SetClip(System::Drawing::Rectangle rect, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip(System.Drawing.Rectangle rect, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.Rectangle * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (rect As Rectangle, combineMode As CombineMode)
매개 변수
- combineMode
- CombineMode
사용할 결합 작업을 지정하는 열거형의 CombineMode 멤버입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
클리핑 영역에 대한 작은 사각형을 만듭니다.
멤버를 사용하여 클리핑 영역을 사각형으로 Replace 설정합니다.
큰 사각형을 단색 검정 브러시로 채웁니다.
그 결과 작고 채워진 검은색 사각형이 생성됩니다.
public:
void SetClipRectangleCombine( PaintEventArgs^ e )
{
// Create rectangle for clipping region.
Rectangle clipRect = Rectangle(0,0,100,100);
// Set clipping region of graphics to rectangle.
e->Graphics->SetClip( clipRect, CombineMode::Replace );
// Fill rectangle to demonstrate clip region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
}
private void SetClipRectangleCombine(PaintEventArgs e)
{
// Create rectangle for clipping region.
Rectangle clipRect = new Rectangle(0, 0, 100, 100);
// Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect, CombineMode.Replace);
// Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRectangleCombine(ByVal e As PaintEventArgs)
' Create rectangle for clipping region.
Dim clipRect As New Rectangle(0, 0, 100, 100)
' Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect, CombineMode.Replace)
' Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub
적용 대상
SetClip(GraphicsPath, CombineMode)
이 Graphics 클리핑 영역을 현재 클립 영역과 GraphicsPath지정된 클립 영역을 결합한 지정된 작업의 결과로 설정합니다.
public:
void SetClip(System::Drawing::Drawing2D::GraphicsPath ^ path, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip(System.Drawing.Drawing2D.GraphicsPath path, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.Drawing2D.GraphicsPath * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (path As GraphicsPath, combineMode As CombineMode)
매개 변수
- path
- GraphicsPath
GraphicsPath 결합할 수 있습니다.
- combineMode
- CombineMode
사용할 결합 작업을 지정하는 열거형의 CombineMode 멤버입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
그래픽 경로를 만들고 경로에 줄임표를 추가합니다.
멤버를 사용하여 클리핑 영역을 타원형 경로로 Replace 설정합니다.
큰 사각형을 단색 검정 브러시로 채웁니다.
결과는 채워진 검은색 줄임표입니다.
public:
void SetClipPathCombine( PaintEventArgs^ e )
{
// Create graphics path.
GraphicsPath^ clipPath = gcnew GraphicsPath;
clipPath->AddEllipse( 0, 0, 200, 100 );
// Set clipping region to path.
e->Graphics->SetClip( clipPath, CombineMode::Replace );
// Fill rectangle to demonstrate clipping region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
}
private void SetClipPathCombine(PaintEventArgs e)
{
// Create graphics path.
GraphicsPath clipPath = new GraphicsPath();
clipPath.AddEllipse(0, 0, 200, 100);
// Set clipping region to path.
e.Graphics.SetClip(clipPath, CombineMode.Replace);
// Fill rectangle to demonstrate clipping region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipPathCombine(ByVal e As PaintEventArgs)
' Create graphics path.
Dim clipPath As New GraphicsPath
clipPath.AddEllipse(0, 0, 200, 100)
' Set clipping region to path.
e.Graphics.SetClip(clipPath, CombineMode.Replace)
' Fill rectangle to demonstrate clipping region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub
설명
매개 변수가 나타내는 path 그래픽 경로가 닫혀 있지 않으면 마지막 지점에서 첫 번째 지점까지 추가 세그먼트가 추가되어 경로를 닫습니다.
적용 대상
SetClip(Graphics, CombineMode)
public:
void SetClip(System::Drawing::Graphics ^ g, System::Drawing::Drawing2D::CombineMode combineMode);
public void SetClip(System.Drawing.Graphics g, System.Drawing.Drawing2D.CombineMode combineMode);
member this.SetClip : System.Drawing.Graphics * System.Drawing.Drawing2D.CombineMode -> unit
Public Sub SetClip (g As Graphics, combineMode As CombineMode)
매개 변수
- g
- Graphics
- combineMode
- CombineMode
사용할 결합 작업을 지정하는 열거형의 CombineMode 멤버입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse 및 예제의 FormthisForm 필요합니다. 코드는 다음 작업을 수행합니다.
임시 Graphics 의 클리핑 영역을 작은 사각형으로 설정합니다.
폼 그래픽 개체의 클리핑 영역을 멤버를 사용하여 새 Graphics 개체의 클리핑 영역으로 Replace 업데이트합니다.
큰 사각형을 단색 검정 브러시로 채웁니다.
결과는 작고 채워진 검은색 사각형입니다.
public:
void SetClipGraphicsCombine( PaintEventArgs^ e )
{
// Create temporary graphics object and set its clipping region.
Graphics^ newGraphics = this->CreateGraphics();
newGraphics->SetClip( Rectangle(0,0,100,100) );
// Update clipping region of graphics to clipping region of new
// graphics.
e->Graphics->SetClip( newGraphics, CombineMode::Replace );
// Fill rectangle to demonstrate clip region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
// Release new graphics.
delete newGraphics;
}
private void SetClipGraphicsCombine(PaintEventArgs e)
{
// Create temporary graphics object and set its clipping region.
Graphics newGraphics = this.CreateGraphics();
newGraphics.SetClip(new Rectangle(0, 0, 100, 100));
// Update clipping region of graphics to clipping region of new
// graphics.
e.Graphics.SetClip(newGraphics, CombineMode.Replace);
// Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
// Release new graphics.
newGraphics.Dispose();
}
Private Sub SetClipGraphicsCombine(ByVal e As PaintEventArgs)
' Create temporary graphics object and set its clipping region.
Dim newGraphics As Graphics = Me.CreateGraphics()
newGraphics.SetClip(New Rectangle(0, 0, 100, 100))
' Update clipping region of graphics to clipping region of new
' graphics.
e.Graphics.SetClip(newGraphics, CombineMode.Replace)
' Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
' Release new graphics.
newGraphics.Dispose()
End Sub
적용 대상
SetClip(Rectangle)
public:
void SetClip(System::Drawing::Rectangle rect);
public void SetClip(System.Drawing.Rectangle rect);
member this.SetClip : System.Drawing.Rectangle -> unit
Public Sub SetClip (rect As Rectangle)
매개 변수
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
클리핑 영역에 대한 작은 사각형을 만듭니다.
클리핑 영역을 사각형으로 설정합니다.
큰 사각형을 단색 검정 브러시로 채웁니다.
그 결과 작고 채워진 검은색 사각형이 생성됩니다.
public:
void SetClipRectangle( PaintEventArgs^ e )
{
// Create rectangle for clipping region.
Rectangle clipRect = Rectangle(0,0,100,100);
// Set clipping region of graphics to rectangle.
e->Graphics->SetClip( clipRect );
// Fill rectangle to demonstrate clip region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
}
private void SetClipRectangle(PaintEventArgs e)
{
// Create rectangle for clipping region.
Rectangle clipRect = new Rectangle(0, 0, 100, 100);
// Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect);
// Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRectangle(ByVal e As PaintEventArgs)
' Create rectangle for clipping region.
Dim clipRect As New Rectangle(0, 0, 100, 100)
' Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect)
' Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub
적용 대상
SetClip(Graphics)
public:
void SetClip(System::Drawing::Graphics ^ g);
public void SetClip(System.Drawing.Graphics g);
member this.SetClip : System.Drawing.Graphics -> unit
Public Sub SetClip (g As Graphics)
매개 변수
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse 및 예제의 FormthisForm 필요합니다. 코드는 다음 작업을 수행합니다.
임시 Graphics 의 클리핑 영역을 작은 사각형으로 설정합니다.
폼 그래픽 개체의 클리핑 영역을 임시 개체의 클리핑 영역으로 업데이트합니다 Graphics.
큰 사각형을 단색 검정 브러시로 채웁니다.
결과는 작고 채워진 검은색 사각형입니다.
public:
void SetClipGraphics( PaintEventArgs^ e )
{
// Create temporary graphics object and set its clipping region.
Graphics^ newGraphics = this->CreateGraphics();
newGraphics->SetClip( Rectangle(0,0,100,100) );
// Update clipping region of graphics to clipping region of new
// graphics.
e->Graphics->SetClip( newGraphics );
// Fill rectangle to demonstrate clip region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
// Release new graphics.
delete newGraphics;
}
private void SetClipGraphics(PaintEventArgs e)
{
// Create temporary graphics object and set its clipping region.
Graphics newGraphics = this.CreateGraphics();
newGraphics.SetClip(new Rectangle(0, 0, 100, 100));
// Update clipping region of graphics to clipping region of new
// graphics.
e.Graphics.SetClip(newGraphics);
// Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
// Release new graphics.
newGraphics.Dispose();
}
Private Sub SetClipGraphics(ByVal e As PaintEventArgs)
' Create temporary graphics object and set its clipping region.
Dim newGraphics As Graphics = Me.CreateGraphics()
newGraphics.SetClip(New Rectangle(0, 0, 100, 100))
' Update clipping region of graphics to clipping region of new
' graphics.
e.Graphics.SetClip(newGraphics)
' Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
' Release new graphics.
newGraphics.Dispose()
End Sub
적용 대상
SetClip(GraphicsPath)
이 Graphics 클리핑 영역을 지정된 GraphicsPath영역으로 설정합니다.
public:
void SetClip(System::Drawing::Drawing2D::GraphicsPath ^ path);
public void SetClip(System.Drawing.Drawing2D.GraphicsPath path);
member this.SetClip : System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub SetClip (path As GraphicsPath)
매개 변수
- path
- GraphicsPath
GraphicsPath 새 클립 영역을 나타내는 입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
그래픽 경로를 만들고 경로에 줄임표를 추가합니다.
클리핑 영역을 타원형 경로로 설정합니다.
큰 사각형을 단색 검정 브러시로 채웁니다.
결과는 채워진 검은색 줄임표입니다.
public:
void SetClipPath( PaintEventArgs^ e )
{
// Create graphics path.
GraphicsPath^ clipPath = gcnew GraphicsPath;
clipPath->AddEllipse( 0, 0, 200, 100 );
// Set clipping region to path.
e->Graphics->SetClip( clipPath );
// Fill rectangle to demonstrate clipping region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
}
private void SetClipPath(PaintEventArgs e)
{
// Create graphics path.
GraphicsPath clipPath = new GraphicsPath();
clipPath.AddEllipse(0, 0, 200, 100);
// Set clipping region to path.
e.Graphics.SetClip(clipPath);
// Fill rectangle to demonstrate clipping region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipPath(ByVal e As PaintEventArgs)
' Create graphics path.
Dim clipPath As New GraphicsPath
clipPath.AddEllipse(0, 0, 200, 100)
' Set clipping region to path.
e.Graphics.SetClip(clipPath)
' Fill rectangle to demonstrate clipping region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub
설명
매개 변수가 나타내는 path 그래픽 경로가 닫혀 있지 않으면 마지막 지점에서 첫 번째 지점까지 추가 세그먼트가 추가되어 경로를 닫습니다.
적용 대상
SetClip(RectangleF)
이 Graphics 영역의 클리핑 영역을 구조체로 지정된 사각형으로 RectangleF 설정합니다.
public:
void SetClip(System::Drawing::RectangleF rect);
public void SetClip(System.Drawing.RectangleF rect);
member this.SetClip : System.Drawing.RectangleF -> unit
Public Sub SetClip (rect As RectangleF)
매개 변수
- rect
- RectangleF
RectangleF 새 클립 영역을 나타내는 구조체입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
클리핑 영역에 대한 작은 사각형을 만듭니다.
클리핑 영역을 사각형으로 설정합니다.
큰 사각형을 단색 검정 브러시로 채웁니다.
그 결과 작고 채워진 검은색 사각형이 생성됩니다.
public:
void SetClipRectangleF( PaintEventArgs^ e )
{
// Create rectangle for clipping region.
RectangleF clipRect = RectangleF(0.0F,0.0F,100.0F,100.0F);
// Set clipping region of graphics to rectangle.
e->Graphics->SetClip( clipRect );
// Fill rectangle to demonstrate clip region.
e->Graphics->FillRectangle( gcnew SolidBrush( Color::Black ), 0, 0, 500, 300 );
}
private void SetClipRectangleF(PaintEventArgs e)
{
// Create rectangle for clipping region.
RectangleF clipRect = new RectangleF(0.0F, 0.0F, 100.0F, 100.0F);
// Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect);
// Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
}
Private Sub SetClipRectangleF(ByVal e As PaintEventArgs)
' Create rectangle for clipping region.
Dim clipRect As New RectangleF(0.0F, 0.0F, 100.0F, 100.0F)
' Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect)
' Fill rectangle to demonstrate clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub