DivisionUnit.Transform 屬性
取得 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# 範例會建立 Divider 物件 theDivider (其中包含 Strokes 集合 theStrokes),並且使用 RecognizerContext 物件 theRecognizerContext。它會呼叫 Divide 方法,以取得分析結果 theResult 的快照。呼叫 ResultByType 方法時會將 divisionType 參數設定為 Line (即 InkDivisionType 列舉型別),以擷取 theResult 中的所有行單位。針對集合中的每一行 (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 範例會建立 Divider 物件 theDivider (其中包含 Strokes 集合 theStrokes),並且使用 RecognizerContext 物件 theRecognizerContext。它會呼叫 Divide 方法,以取得分析結果 theResult 的快照。呼叫 ResultByType 方法時會將 divisionType 參數設定為 Line (即 InkDivisionType 列舉型別),以擷取 theResult 中的所有行單位。針對集合中的每一行 (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