DivisionUnit オブジェクトがストロークを横方向に回転するために使用する変換行列を取得します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink (Microsoft.Ink.dll 内)
構文
'宣言
Public ReadOnly Property Transform As Matrix
'使用
Dim instance As DivisionUnit
Dim value As Matrix
value = instance.Transform
public Matrix Transform { get; }
public:
property Matrix^ Transform {
Matrix^ get ();
}
/** @property */
public Matrix get_Transform()
public function get Transform () : Matrix
プロパティ値
型 : System.Drawing.Drawing2D.Matrix
DivisionUnit オブジェクトがストロークを横方向に回転するために使用する変換行列。
解説
テキスト認識エンジンは、横方向の手書きの場合に最高のパフォーマンスを発揮します。この変換は、ストロークを RecognizerContext オブジェクトに渡す前に DivisionUnit オブジェクトの Strokes プロパティに適用します。
行列の回転点は、セグメントと行の両方の境界ボックスの左下隅に設定されます。認識セグメントの回転角度は、セグメントが含まれる行の角度と同じです。
![]() |
---|
段落または描画を表す DivisionUnit オブジェクトの場合、このプロパティは恒等行列を返します。 |
手書きを横方向にしたり、斜めの手書きの周りに線または図形を正確に描画するには、このプロパティを使用します。
例
この C# の例では、Strokes コレクション theStrokes が含まれる Divider オブジェクト theDivider を作成し、RecognizerContext オブジェクト theRecognizerContext を使用します。Divide メソッドは、分析結果 theResult のスナップショットを取得するために呼び出されます。ResultByType メソッドは、theResult 内のすべての行単位を取得するために、Line に設定された divisionType パラメータ、InkDivisionType 列挙子を使用して呼び出されます。コレクション内の theLine 行ごとに、DivisionType、Strokes、RecognitionString、および Transform プロパティが取得されます。
// 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;
}
この Microsoft® Visual Basic® .NET の例では、Strokes コレクション theStrokes が含まれる Divider オブジェクト theDivider を作成し、RecognizerContext オブジェクト theRecognizerContext を使用します。Divide メソッドは、分析結果 theResult のスナップショットを取得するために呼び出されます。ResultByType メソッドは、theResult 内のすべての行単位を取得するために、Line に設定された divisionType パラメータ、InkDivisionType 列挙子を使用して呼び出されます。コレクション内の theLine 行ごとに、DivisionType、Strokes、RecognitionString、および Transform プロパティが取得されます。
' 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