Divider.Divide - метод
Обновлен: Ноябрь 2007
Returns a DivisionResult object containing structural information about the Strokes property of the Divider object.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Function Divide As DivisionResult
'Применение
Dim instance As Divider
Dim returnValue As DivisionResult
returnValue = instance.Divide()
public DivisionResult Divide()
public:
DivisionResult^ Divide()
public DivisionResult Divide()
public function Divide() : DivisionResult
Возвращаемое значение
Тип: Microsoft.Ink.DivisionResult
Returns a DivisionResult object containing structural information about the Strokes property of the Divider object.
Заметки
This method returns a new DivisionResult object each time this method is called.
The Divide method's return value stores results of a layout analysis in the Strokes property of the Divider object.
Примеры
This C# example creates a Divider object, theDivider, which contains a Strokes collection, theStrokes, and uses a RecognizerContext object, theRecognizerContext. The Divide method is called to get a snapshot of the analysis results, theResult. The ResultByType method is called with the divisionType parameter set to Line, a InkDivisionType enumeration, to retrieve all of the line units within theResult. For each line, theLine, in the Strokes collection, the DivisionUnit.DivisionType, DivisionUnit.Strokes, DivisionUnit.RecognitionString, and DivisionUnit.Transform properties are retrieved.
// Create the Divider and assign a Strokes collection to it.
Divider theDivider = new Divider(theStrokes, theRecognizerContext);
// Retrieve the analysis result, and divide the result by line.
DivisionResult theResult = theDivider.Divide();
DivisionUnits theDivisionUnits =
theResult.ResultByType(InkDivisionType.Line);
foreach (DivisionUnit theLine in theDivisionUnits)
{
// For each line element in the collection
// retrieve the division type, the strokes,
// the recognition string, and the rotation transform.
InkDivisionType theDivisionType = theLine.DivisionType;
Strokes elementStrokes = theLine.Strokes;
string theRecognitionString = theLine.RecognitionString;
System.Drawing.Drawing2D.Matrix theInkTransform =
theLine.Transform;
}
This Visual Basic .NET example creates a Divider object, theDivider, containing a Strokes collection, theStrokes, and using a RecognizerContext object, theRecognizerContext. The Divide method returns a snapshot of the analysis results, theResult. The ResultByType method is called with the divisionType parameter set to Line, a InkDivisionType enumeration, retrieving all line units within theResult. For each line, theLine, in the Strokes collection, the DivisionUnit.DivisionType, DivisionUnit.Strokes, DivisionUnit.RecognitionString, and DivisionUnit.Transform properties are retrieved.
' Create the Divider and assign a Strokes collection to it.
Dim theDivider As Divider = New Divider(theStrokes, theRecognizerContext)
' Retrieve the analysis result, and divide the result by line.
Dim theResult As DivisionResult = theDivider.Divide()
Dim theDivisionUnits As DivisionUnits = _
theResult.ResultByType(InkDivisionType.Line)
Dim theLine As DivisionUnit
For Each theLine In theDivisionUnits
' For each line element in the collection
' retrieve the division type, the strokes,
' the recognition string, and the rotation transform.
Dim theDivisionType As InkDivisionType = theLine.DivisionType
Dim elementStrokes As Strokes = theLine.Strokes
Dim theRecognitionString As String = theLine.RecognitionString
Dim theInkTransform As System.Drawing.Drawing2D.Matrix = _
theLine.Transform
Next
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0