共用方式為


AnalysisStatus.AppliedChangesRegion 屬性

傳回 InkAnalyzer 已經變更 ContextNode 樹狀目錄的文件區域。

命名空間:  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。例如,應用程式可能會繪製可以點擊的特殊標記,以便供使用者修改分析結果。

範例

下列範例是 BackgroundAnalyze 完成分析時所呼叫的 ResultsUpdated 事件處理常式。這個事件處理常式會在筆劃分析完成之後將 DrawingAttributes 變更為紅色,以做為偵錯之用。它只會使用 AppliedChangesRegion 更新發生變更的區域,而不會更新整個控制項。這個範例使用的 InkCollector (theInkCollector) 會收集 System.Windows.Forms.Panel (英文) (panelForInk) 中的筆墨。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 命名空間