업데이트: 2007년 11월
Stroke를 InkAnalyzer에 추가하고 활성 입력 스레드의 로캘 식별자를 스트로크에 할당합니다.
네임스페이스: System.Windows.Ink
어셈블리: IAWinFX(IAWinFX.dll)
구문
‘선언
Public Function AddStroke ( _
strokeToAdd As Stroke _
) As ContextNode
‘사용 방법
Dim instance As InkAnalyzer
Dim strokeToAdd As Stroke
Dim returnValue As ContextNode
returnValue = instance.AddStroke(strokeToAdd)
public ContextNode AddStroke(
Stroke strokeToAdd
)
public:
ContextNode^ AddStroke(
Stroke^ strokeToAdd
)
public ContextNode AddStroke(
Stroke strokeToAdd
)
public function AddStroke(
strokeToAdd : Stroke
) : ContextNode
매개 변수
- strokeToAdd
형식: System.Windows.Ink.Stroke
InkAnalyzer 에 추가할 Stroke입니다.
반환 값
형식: System.Windows.Ink.ContextNode
strokeToAdd가 추가된 ContextNode입니다.
설명
InkAnalyzer는 RootNode 속성 SubNodes 컬렉션의 UnclassifiedInkNode에 Stroke를 추가합니다. strokeToAdd라는 Stroke에는 활성 입력 스레드에서 사용되는 것과 동일한 로캘 식별자가 할당됩니다. 그런 다음 동일한 로캘 식별자로 특성이 지정된 스트로크가 들어 있는 첫 번째 UnclassifiedInkNode에 Stroke가 추가됩니다. 이러한 UnclassifiedInkNode가 없으면 새 UnclassifiedInkNode가 만들어지고 새 UnclassifiedInkNode에 strokeToAdd가 추가됩니다.
이 메서드는 DirtyRegion을 영역의 현재 값과 추가된 스트로크의 경계 상자를 합친 영역으로 확장합니다.
스트로크가 이미 InkAnalyzer에 연결된 경우 InkAnalyzer에서 예외가 throw됩니다.
예제
다음 예제에서는 새 InkAnalyzer를 만들고 theInkCanvas라는 InkCanvas의 Strokes 속성에 StrokesChanged 이벤트 처리기를 연결합니다.
theInkAnalyzer = New InkAnalyzer()
AddHandler theInkCanvas.Strokes.StrokesChanged, AddressOf Strokes_StrokesChanged
theInkAnalyzer = new InkAnalyzer();
theInkCanvas.Strokes.StrokesChanged +=
new StrokeCollectionChangedEventHandler(Strokes_StrokesChanged);
다음 예제에서는 스트로크가 theInkCanvas에 이미 추가된 경우 theInkAnalyzer에 스트로크를 추가하는 Strokes_StrokesChanged 이벤트 처리기를 정의합니다. 또한 스트로크가 theInkCanvas에서 이미 제거된 경우에는 theInkAnalyzer에서 스트로크를 제거합니다.
' This event occurs whenever a stroke is added, removed, or partially erased
' from the InkCanvas.
Sub Strokes_StrokesChanged(ByVal sender As Object, ByVal e As StrokeCollectionChangedEventArgs)
If e.Added.Count > 0 Then
theInkAnalyzer.AddStrokes(e.Added)
End If
If e.Removed.Count > 0 Then
theInkAnalyzer.RemoveStrokes(e.Removed)
End If
End Sub 'Strokes_StrokesChanged
// This event occurs whenever a stroke is added, removed, or partially erased
// from the InkCanvas.
void Strokes_StrokesChanged(object sender, StrokeCollectionChangedEventArgs e)
{
if (e.Added.Count > 0)
{
theInkAnalyzer.AddStrokes(e.Added);
}
if (e.Removed.Count > 0)
{
theInkAnalyzer.RemoveStrokes(e.Removed);
}
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원
참고 항목
참조
InkAnalyzerRemoveStroke()
InkAnalyzerRemoveStrokes()