다음을 통해 공유


InkAnalyzer 생성자 (Dispatcher)

업데이트: 2007년 11월

특정 Dispatcher 개체로 InkAnalyzer 클래스의 새 인스턴스를 초기화합니다. 이 개체는 백그라운드 분석 이벤트를 동기화하는 데 사용됩니다.

네임스페이스:  System.Windows.Ink
어셈블리:  IAWinFX(IAWinFX.dll)

구문

‘선언
Public Sub New ( _
    synchronizingObject As Dispatcher _
)
‘사용 방법
Dim synchronizingObject As Dispatcher

Dim instance As New InkAnalyzer(synchronizingObject)
public InkAnalyzer(
    Dispatcher synchronizingObject
)
public:
InkAnalyzer(
    Dispatcher^ synchronizingObject
)
public InkAnalyzer(
    Dispatcher synchronizingObject
)
public function InkAnalyzer(
    synchronizingObject : Dispatcher
)

매개 변수

예제

다음 예제에서는 새 InkAnalyzer를 만들고 theInkCanvas라는 InkCanvasStrokes 속성에 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에서 지원

참고 항목

참조

InkAnalyzer 클래스

InkAnalyzer 멤버

InkAnalyzer 오버로드

System.Windows.Ink 네임스페이스

Ink