InkAnalyzerBase.Load - метод
Обновлен: Ноябрь 2007
Loads saved analysis results into the ink analyzer.
Пространство имен: System.Windows.Ink.AnalysisCore
Сборка: IACore (в IACore.dll)
Синтаксис
'Декларация
Public Function Load ( _
serializedResults As Byte(), _
originalToNewStrokeIdMap As Hashtable _
) As Boolean
'Применение
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 boolean Load(
byte[] serializedResults,
Hashtable originalToNewStrokeIdMap
)
public function Load(
serializedResults : byte[],
originalToNewStrokeIdMap : Hashtable
) : boolean
Параметры
- serializedResults
Тип: array<System.Byte[]
An 8-bit unsigned integer array containing the saved analysis results.
- originalToNewStrokeIdMap
Тип: System.Collections.Hashtable
A mapping of old stroke identifiers to new stroke identifiers, or nullссылка null (Nothing в Visual Basic) to keep the original stroke identifiers.
Возвращаемое значение
Тип: System.Boolean
true if the ink analyzer loaded the analysis results; otherwise, false.
Заметки
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.
Примеры
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.
}
Платформы
Windows Vista, Windows XP с пакетом обновления 2 (SP2), Windows Server 2003
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0
См. также
Ссылки
System.Windows.Ink.AnalysisCore - пространство имен