Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns the region of the document that corresponds to changes that were made in the context node tree as a result of a call to InkAnalyzer.Analyze or InkAnalyzerBase.BackgroundAnalyze.
Namespace: System.Windows.Ink.AnalysisCore
Assembly: IACore (in IACore.dll)
Syntax
'Declaration
Public ReadOnly Property AppliedChangesRegion As AnalysisRegionBase
'Usage
Dim instance As AnalysisStatusBase
Dim value As AnalysisRegionBase
value = instance.AppliedChangesRegion
public AnalysisRegionBase AppliedChangesRegion { get; }
public:
property AnalysisRegionBase^ AppliedChangesRegion {
AnalysisRegionBase^ get ();
}
public function get AppliedChangesRegion () : AnalysisRegionBase
Property Value
Type: System.Windows.Ink.AnalysisCore.AnalysisRegionBase
The AnalysisRegionBase of the document where changes were updated.
Remarks
AppliedChangesRegion is most often used when the application has drawn some information for debugging purposes and it needs to Invalidate the area where changes would occur so that the debugging information is painted.
Examples
The following example is an event handler for the ResultsUpdated event. This event is called when analysis is completed following a call to BackgroundAnalyze. For debugging purposes, , the DrawingAttributes in the event handler are changed to red when strokes have been analyzed. Rather than updating the entire control, the example uses AppliedChangesRegion to update only where changes have occurred. The example uses an InkCollector named theInkCollector, which inks in a Panel, panelForInk. The analysis is performed by an InkAnalyzerBase named theInkAnalyzerBase.
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);
}
}
Platforms
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0