업데이트: 2007년 11월
InkAnalyzer.Analyze 또는 InkAnalyzerBase.BackgroundAnalyze에 대한 호출 결과로 컨텍스트 노드 트리에서 수행된 변경에 해당하는 문서 영역을 반환합니다.
네임스페이스: System.Windows.Ink.AnalysisCore
어셈블리: IACore(IACore.dll)
구문
‘선언
Public ReadOnly Property AppliedChangesRegion As AnalysisRegionBase
‘사용 방법
Dim instance As AnalysisStatusBase
Dim value As AnalysisRegionBase
value = instance.AppliedChangesRegion
public AnalysisRegionBase AppliedChangesRegion { get; }
public:
property AnalysisRegionBase^ AppliedChangesRegion {
AnalysisRegionBase^ get ();
}
/** @property */
public AnalysisRegionBase get_AppliedChangesRegion()
public function get AppliedChangesRegion () : AnalysisRegionBase
속성 값
형식: System.Windows.Ink.AnalysisCore.AnalysisRegionBase
변경 사항이 업데이트된 문서의 AnalysisRegionBase입니다.
설명
응용 프로그램에서 디버깅 용도로 특정 정보를 그리며, 해당 디버깅 정보를 그리기 때문에 변경이 발생할 수 있는 영역을 Invalidate해야 할 경우 AppliedChangesRegion이 가장 자주 사용됩니다.
예제
다음 예제는 ResultsUpdated 이벤트에 대한 이벤트 처리기입니다. BackgroundAnalyze를 호출한 다음 분석이 완료될 때 이 이벤트가 호출됩니다. 디버깅 용도이므로 스트로크가 분석되면 이벤트 처리기의 DrawingAttributes가 빨간색으로 변경됩니다. 이 예제에서는 전체 컨트롤을 업데이트하는 대신 AppliedChangesRegion을 사용하여 변경이 발생한 영역만 업데이트합니다. 이 예제에서는 panelForInk라는 Panel의 잉크인 이름이 theInkCollector인 InkCollector를 사용합니다. 분석은 이름이 theInkAnalyzerBase인 InkAnalyzerBase로 수행됩니다.
Private Sub theInkAnalyzer_Results(ByVal sender As Object, ByVal e As ResultsUpdatedBaseEventArgs) _
Handles theInkAnalyzerBase.ResultsUpdatedBase
Dim status As AnalysisStatusBase = e.Status
If status.Successful = True Then
' For debugging purposes, show all analyzed strokes as red
Dim analyzedStrokes As Strokes = Me.theInkCollector.Ink.CreateStrokes( _
Me.theInkAnalyzerBase.RootNode.GetStrokeIds())
analyzedStrokes.ModifyDrawingAttributes(New DrawingAttributes(Color.Red))
' Invalidate just the changed region
Dim panelGraphics As Graphics = Me.panelForInk.CreateGraphics()
Dim bounds() As Integer = status.AppliedChangesRegion.GetBounds()
' Increase bounds by pen width
' Increase bounds by pen width
bounds(1) -= CType(Me.theInkCollector.DefaultDrawingAttributes.Width, Integer)
bounds(2) -= CType(Me.theInkCollector.DefaultDrawingAttributes.Height, Integer)
bounds(3) += CType(Me.theInkCollector.DefaultDrawingAttributes.Width, Integer)
bounds(4) += CType(Me.theInkCollector.DefaultDrawingAttributes.Height, Integer)
Dim corner1 As Point = New Point(bounds(1), bounds(2))
Dim corner2 As Point = New Point(bounds(3), bounds(3))
theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, corner1)
theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, corner2)
Dim newBounds As New Rectangle(corner1.X, corner1.Y, corner2.X - corner1.X, _
corner2.Y - corner1.Y)
panelGraphics.Dispose()
panelForInk.Invalidate(newBounds)
End If
End Sub
void theInkAnalyzer_Results(object sender, ResultsUpdatedBaseEventArgs e)
{
AnalysisStatusBase status = e.Status;
if (status.Successful)
{
// For debugging purposes, show all analyzed strokes as red
Strokes analyzedStrokes =
this.theInkCollector.Ink.CreateStrokes(theInkAnalyzerBase.RootNode.GetStrokeIds());
analyzedStrokes.ModifyDrawingAttributes(new DrawingAttributes(Color.Red));
// Invalidate just the changed region
Graphics panelGraphics = this.panelForInk.CreateGraphics();
int[] bounds = status.AppliedChangesRegion.GetBounds();
// Increase bounds by pen width
bounds[0] -= (int)this.theInkCollector.DefaultDrawingAttributes.Width;
bounds[1] -= (int)this.theInkCollector.DefaultDrawingAttributes.Height;
bounds[3] += (int)this.theInkCollector.DefaultDrawingAttributes.Width;
bounds[4] += (int)this.theInkCollector.DefaultDrawingAttributes.Height;
Point corner1 = new Point(bounds[0], bounds[1]);
Point corner2 = new Point(bounds[2], bounds[3]);
theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, ref corner1);
theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, ref corner2);
Rectangle newBounds = new Rectangle(corner1.X, corner1.Y, corner2.X - corner1.X,
corner2.Y - corner1.Y);
panelGraphics.Dispose();
panelForInk.Invalidate(newBounds);
}
}
플랫폼
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원