업데이트: 2007년 11월
Strokes 컬렉션의 모든 Stroke 개체에서 지정된 사각형을 벗어나는 부분을 제거합니다.
네임스페이스: Microsoft.Ink
어셈블리: Microsoft.Ink(Microsoft.Ink.dll)
구문
‘선언
Public Sub Clip ( _
r As Rectangle _
)
‘사용 방법
Dim instance As Strokes
Dim r As Rectangle
instance.Clip(r)
public void Clip(
Rectangle r
)
public:
void Clip(
Rectangle r
)
public void Clip(
Rectangle r
)
public function Clip(
r : Rectangle
)
매개 변수
- r
형식: System.Drawing.Rectangle
설명
R 매개 변수는 잉크 공간 좌표로 지정됩니다.
이 메서드는 부모 Ink 개체를 업데이트합니다. Ink 개체에서 잉크를 제거하면 해당 Ink 개체에 정의된 Stroke 개체나 Strokes 컬렉션이 모두 무효화됩니다.
Clip 메서드를 호출한 후 각 Stroke 개체의 속성이 변경될 수 있습니다. 예를 들어 Stroke 개체가 클립 사각형의 영역 내에서 시작되는 경우 이 개체는 두 Stroke 개체가 되며, 두 개체 중 최소한 하나에는 새 Id 속성이 있습니다. 이러한 동작이 발생해도 모든 Id 속성은 Ink 개체 내에서 항상 고유하며, 속성이 변경되는 경우에도 마찬가지입니다. Stroke 개체의 다른 속성도 비슷하게 변경될 수 있습니다.
예제
이 예제에서는 InkOverlay 개체의 Strokes 컬렉션을 Strokes 컬렉션의 오른쪽 절반으로 자릅니다. 우선 GetBoundingBox 메서드를 호출하여 Strokes 컬렉션의 경계 사각형을 가져옵니다. 그런 다음 오른쪽 절반을 잘라낸 새 사각형을 만들어 Clip 메서드에 전달합니다.
' Access to the Strokes property returns a copy of the Strokes object.
' This copy must be implicitly (via using statement) or explicitly
' disposed of in order to avoid a memory leak.
Using allStrokes As Strokes = mInkOverlay.Ink.Strokes
' Determine the bounding box for the Strokes collection.
Dim bounds As Rectangle = allStrokes.GetBoundingBox()
'Create rectangle for Clip method.
Dim halfRectangle As Rectangle = _
New Rectangle(bounds.Left, bounds.Top, bounds.Width / 2, bounds.Height)
' Clip the Strokes collection.
allStrokes.Clip(halfRectangle)
End Using
// Access to the Strokes property returns a copy of the Strokes object.
// This copy must be implicitly (via using statement) or explicitly
// disposed of in order to avoid a memory leak.
using (Strokes allStrokes = mInkOverlay.Ink.Strokes)
{
// Determine the bounding box for the Strokes collection.
Rectangle bounds = allStrokes.GetBoundingBox();
//Create rectangle for Clip method.
Rectangle halfRectangle =
new Rectangle(bounds.Left, bounds.Top, bounds.Width / 2, bounds.Height);
// Clip the Strokes collection.
allStrokes.Clip(halfRectangle);
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원