Sdílet prostřednictvím


InkAnalyzerBase.Load Method

Loads saved analysis results into the ink analyzer.

Namespace:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Syntax

'Declaration
Public Function Load ( _
    serializedResults As Byte(), _
    originalToNewStrokeIdMap As Hashtable _
) As Boolean
'Usage
Dim instance As InkAnalyzerBase 
Dim serializedResults As Byte()
Dim originalToNewStrokeIdMap As Hashtable 
Dim returnValue As Boolean 

returnValue = instance.Load(serializedResults, _
    originalToNewStrokeIdMap)
public bool Load(
    byte[] serializedResults,
    Hashtable originalToNewStrokeIdMap
)
public:
bool Load(
    array<unsigned char>^ serializedResults, 
    Hashtable^ originalToNewStrokeIdMap
)
public function Load(
    serializedResults : byte[], 
    originalToNewStrokeIdMap : Hashtable
) : boolean

Parameters

  • serializedResults
    Type: array<System.Byte[]

    An 8-bit unsigned integer array containing the saved analysis results.

  • originalToNewStrokeIdMap
    Type: System.Collections.Hashtable

    A mapping of old stroke identifiers to new stroke identifiers, or nulla null reference (Nothing in Visual Basic) to keep the original stroke identifiers.

Return Value

Type: System.Boolean
true if the ink analyzer loaded the analysis results; otherwise, false.

Remarks

When the ink analyzer adds a ContextNodeBase from the saved results, it assigns a new globally unique identifier (GUID) to the ContextNodeBase object's Id property.

This method adds the saved analysis results to the existing ContextNodeBase tree. To ensure that the combined results are ordered correctly, add the area containing the loaded context nodes to the ink analyzer's DirtyRegion and reanalyze the ink.

The SaveResults method does not save the packet data along with the analysis results.

Each key in originalToNewStrokeIdMap is the stroke identifier for the stroke in the saved analysis results. Each value in originalToNewStrokeIdMap is the new identifier with which to replace the original identifier in the loaded analysis results.

If a saved analysis hint conflicts with an existing analysis hint, the ink analyzer does not load the saved hint but does load the rest of the saved results. However, if the analyzer loads results for a stroke that is within the area of a saved analysis hint that the analyzer does not load, the analyzer adds the bounding box of the stroke to the InkAnalyzerBase object's DirtyRegion property. Also, if the analyzer loads results for a stroke that is within an existing analysis hint's area, the analyzer also adds the bounding box of the stroke to the InkAnalyzerBase object's DirtyRegion property. For more information about analysis hints, see PropertyGuidsForAnalysisHintsBase.

The InkAnalyzerBase raises the ContextNodeCreatedBase, ContextNodeLinkAddingBase, and ContextNodePropertiesUpdatedBase events as it loads the saved results.

Examples

The following example loads saved analysis results from the 8-bit unsigned integer array, savedResults. The example loads the results into the InkAnalyzerBase, theInkAnalyzerBase. This example does not show how to calculate new stroke identifiers when the ink analyzer already contains stroke data.

' Load previously saved analysis results 
Dim successful As Boolean = False 
If 0 = theInkAnalyzerBase.RootNode.GetStrokeIds().Length Then 
    ' If the analyzer does not already contain stroke data, do not 
    ' remap the identifiers for the strokes.
    successful = theInkAnalyzerBase.Load(savedResults, Nothing)
Else 
    ' If the analyzer does already contain stroke data, remap the stroke 
    ' identifiers for the saved stroke data. Then use that remapping 
    ' to load the results. 
End If
// Load previously saved analysis results 
bool successful = false;
if (0 == theInkAnalyzerBase.RootNode.GetStrokeIds().Length)
{
    // If the analyzer does not already contain stroke data, do not 
    // remap the identifiers for the strokes.
    successful = theInkAnalyzerBase.Load(savedResults, null);
}
else
{
    // If the analyzer does already contain stroke data, remap the stroke 
    // identifiers for the saved stroke data. Then use that remapping 
    // to load the results.
}

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

See Also

Reference

InkAnalyzerBase Class

InkAnalyzerBase Members

System.Windows.Ink.AnalysisCore Namespace

System.Windows.Ink.AnalysisCore.ContextNodeBase

InkAnalyzerBase.DirtyRegion

InkAnalyzerBase.SaveResults