次の方法で共有


AnalysisStatus.AppliedChangesRegion プロパティ

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 は、変更のある領域をアプリケーションが 無効化する必要がある場合に使用されます。たとえば、アプリケーションは分析結果を変更するときにユーザーがクリックする特殊なタグを描画できます。

次の例に、BackgroundAnalyze が分析を完了したときに呼び出される ResultsUpdated イベント ハンドラを示します。このイベント ハンドラでは、ストロークが分析されると DrawingAttributes がデバッグ目的で赤色に変更されます。コントロール全体を更新するのではなく、AppliedChangesRegion を使用して変更が加えられた領域のみ更新します。この例では、System.Windows.Forms.PanelpanelForInk でインクを収集する InkCollectortheInkCollector を使用します。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 名前空間