InkAnalyzer.Load Method (Stream, Boolean)
Loads saved analysis results into the InkAnalyzer.
Namespace: System.Windows.Ink
Assembly: IAWinFX (in IAWinFX.dll)
Syntax
'Declaration
Public Function Load ( _
stream As Stream, _
doNotAutoAddStrokes As Boolean _
) As Boolean
'Usage
Dim instance As InkAnalyzer
Dim stream As Stream
Dim doNotAutoAddStrokes As Boolean
Dim returnValue As Boolean
returnValue = instance.Load(stream, doNotAutoAddStrokes)
public bool Load(
Stream stream,
bool doNotAutoAddStrokes
)
public:
bool Load(
Stream^ stream,
bool doNotAutoAddStrokes
)
public function Load(
stream : Stream,
doNotAutoAddStrokes : boolean
) : boolean
Parameters
stream
Type: System.IO.StreamA stream containing the saved analysis results.
doNotAutoAddStrokes
Type: System.Booleantrue to exclude strokes that were not previously added to an InkAnalyzer; otherwise, false.
Return Value
Type: System.Boolean
true if the analysis results loaded successfully; otherwise, false.
Remarks
In other layers of ink analysis, such as the Windows Forms layer, the ink analyzer can save strokes without adding them. If doNotAutoAddStrokes is true, the InkAnalyzer ignores strokes that were not added to an ink analyzer when the strokes were saved.
Note
The InkAnalyzer that ships with the Windows Presentation Foundation does not save strokes that are not added to the InkAnalyzer. When the ink is saved by the System.Windows.Ink.InkAnalyzer, doNotAutoAddStroke does not affect the behavior of the Load(Stream, Boolean) method
When the InkAnalyzer adds a ContextNode from the saved results, it assigns a new globally unique identifier (GUID) to the ContextNode object's Id property.
This method appends the saved analysis results to existing results. 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.
If a saved analysis hint conflicts with an existing analysis hint, the InkAnalyzer does not load the saved hint but loads the rest of the saved results. However, if saved stroke data is within the area of a saved analysis hint that is not loaded, InkAnalyzer adds the bounding box of the stroke to the analyzer's DirtyRegion. If saved stroke data is within an existing analysis hint's area, the analyzer also adds the bounding box of the stroke to the analyzer's DirtyRegion. For more information about analysis hints, see AnalysisHintNode.
The InkAnalyzer raises the ContextNodeCreated, ContextNodeLinkAdding, and ContextNodePropertiesUpdated events as it loads the saved results.
Examples
This example loads saved analysis results from a MemoryStream, theSavedResults, into a InkAnalyzer named theInkAnalyzer.
' Load previously saved analysis results, but do not load
' associated ink data.
successful = Me.theInkAnalyzer.Load(theSavedResults, True)
// Load previously saved analysis results, but do not load
// associated ink data.
successful = this.theInkAnalyzer.Load(theSavedResults, true);
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
InkAnalyzerInk
System.Windows.Ink.ContextNode
Ink