다음을 통해 공유


AnalysisStatus.AppliedChangesRegion 속성

업데이트: 2007년 11월

InkAnalyzerContextNode 트리를 변경한 문서 영역을 반환합니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink.Analysis(Microsoft.Ink.Analysis.dll)

구문

‘선언
Public ReadOnly Property AppliedChangesRegion As AnalysisRegion
‘사용 방법
Dim instance As AnalysisStatus
Dim value As AnalysisRegion

value = instance.AppliedChangesRegion
public AnalysisRegion AppliedChangesRegion { get; }
public:
property AnalysisRegion^ AppliedChangesRegion {
    AnalysisRegion^ get ();
}
/** @property */
public AnalysisRegion get_AppliedChangesRegion()
public function get AppliedChangesRegion () : AnalysisRegion

속성 값

형식: Microsoft.Ink.AnalysisRegion
변경 사항이 업데이트된 문서의 AnalysisRegion입니다.

설명

AppliedChangesRegion은 응용 프로그램에서 변경 사항이 있는 영역을 Invalidate해야 하는 경우에 사용합니다. 예를 들어 응용 프로그램에서 사용자가 분석 결과를 수정하기 위해 클릭할 특수 태그를 그릴 수 있습니다.

예제

다음 예제는 BackgroundAnalyze에서 분석을 완료하면 호출되는 ResultsUpdated 이벤트 처리기입니다. 이벤트 처리기에서는 스트로크를 분석한 후 디버깅을 위해 DrawingAttributes가 빨간색으로 변경됩니다. 예제에서는 전체 컨트롤을 업데이트하는 대신 AppliedChangesRegion을 사용하여 변경이 발생한 영역만 업데이트합니다. 또한 System.Windows.Forms.Panel인 panelForInk의 잉크를 수집하는 InkCollector인 theInkCollector를 사용합니다. 분석을 수행하는 InkAnalyzer인 theInkAnalyzer입니다.

Private Sub theInkAnalyzer_Results(ByVal sender As Object, ByVal e As ResultsUpdatedEventArgs) _
Handles theInkAnalyzer.ResultsUpdated
    Dim status As AnalysisStatus = e.Status

    If status.Successful = True Then
        ' For debugging purposes, show all analyzed strokes as red
        Me.theInkAnalyzer.RootNode.Strokes.ModifyDrawingAttributes(New DrawingAttributes(Color.Red))

        ' Invalidate just the changed region
        Dim panelGraphics As Graphics = Me.panelForInk.CreateGraphics()
        Dim bounds As Rectangle = status.AppliedChangesRegion.GetBounds()
        ' Increase bounds by pen width
        bounds.Inflate(CType(Me.theInkCollector.DefaultDrawingAttributes.Width, Integer), _
           CType(Me.theInkCollector.DefaultDrawingAttributes.Height, Integer))
        Dim corner1 As Point = bounds.Location
        Dim corner2 As Point = New Point(bounds.Right, bounds.Bottom)
        theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, corner1)
        theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, corner2)
        bounds = New Rectangle(corner1.X, corner1.Y, corner2.X - corner1.X, _
            corner2.Y - corner1.Y)
        panelGraphics.Dispose()
        panelForInk.Invalidate(bounds)
    End If
End Sub
void theInkAnalyzer_ResultsUpdated(object sender, ResultsUpdatedEventArgs e)
{
    AnalysisStatus status = e.Status;

    if (status.Successful)
    {
        // For debugging purposes, show all analyzed strokes as red
        this.theInkAnalyzer.RootNode.Strokes.ModifyDrawingAttributes(new DrawingAttributes(Color.Red));

        // Invalidate just the changed region
        Graphics panelGraphics = this.panelForInk.CreateGraphics();
        Rectangle bounds = status.AppliedChangesRegion.GetBounds();
        // Increase bounds by pen width
        bounds.Inflate((int)this.theInkCollector.DefaultDrawingAttributes.Width,
           (int)this.theInkCollector.DefaultDrawingAttributes.Height);
        Point corner1 = bounds.Location;
        Point corner2 = new Point(bounds.Right, bounds.Bottom);
        theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, ref corner1);
        theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, ref corner2);
        bounds = new Rectangle(corner1.X, corner1.Y, corner2.X - corner1.X,
            corner2.Y - corner1.Y);
        panelGraphics.Dispose();
        panelForInk.Invalidate(bounds);
    }
}

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

AnalysisStatus 클래스

AnalysisStatus 멤버

Microsoft.Ink 네임스페이스