RecognizerGuide.Midline 屬性
取得或設定中線高度。中線高度是繪製方塊從基線到中線的距離。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public Property Midline As Integer
'用途
Dim instance As RecognizerGuide
Dim value As Integer
value = instance.Midline
instance.Midline = value
public int Midline { get; set; }
public:
property int Midline {
int get ();
void set (int value);
}
/** @property */
public int get_Midline()
/** @property */
public void set_Midline(int value)
public function get Midline () : int
public function set Midline (value : int)
屬性值
型別:System.Int32
輔助線的中線高度 (以 HIMETRIC 為單位)。
備註
如果中線不存在,則傳回值為 0。
範例
在這個範例中,會具現化 RecognizerContext 物件,而且會藉由建立新的 RecognizerGuide 物件指派 Guide 屬性。
' create a new RecognizerContext object
mRecognizerContext = New RecognizerContext()
' if the Recognizer supports LinedInput, set the Guide
If (mRecognizerContext.Recognizer.Capabilities And RecognizerCapabilities.LinedInput) <> 0 Then
' get the lower right corner in pixel units
Dim lowerRight As Point = New Point(mInkOverlay.AttachedControl.Width, mInkOverlay.AttachedControl.Height)
' convert to ink space units
mInkOverlay.Renderer.PixelToInkSpace(Me.CreateGraphics(), lowerRight)
' create Rectangles
Dim writingBox As Rectangle = New Rectangle(0, 0, lowerRight.X, lowerRight.Y)
Dim drawnBox As Rectangle = New Rectangle(0, 0, lowerRight.X, lowerRight.Y)
' shrink drawn box relative to writing box
drawnBox.Inflate(-100, -100)
' create Guide with 8 rows, zero columns, and no midline
Dim guide As RecognizerGuide = New RecognizerGuide(8, 0, 0, writingBox, drawnBox)
mRecognizerContext.Guide = guide
End If
// create a new RecognizerContext object
mRecognizerContext = new RecognizerContext();
// if the Recognizer supports LinedInput, set the Guide
if ((mRecognizerContext.Recognizer.Capabilities & RecognizerCapabilities.LinedInput) != 0)
{
// get the lower right corner in pixel units
Point lowerRight = new Point(mInkOverlay.AttachedControl.Width, mInkOverlay.AttachedControl.Height);
// convert to ink space units
mInkOverlay.Renderer.PixelToInkSpace(this.CreateGraphics(), ref lowerRight);
// create Rectangles
Rectangle writingBox = new Rectangle(0, 0, lowerRight.X, lowerRight.Y);
Rectangle drawnBox = new Rectangle(0, 0, lowerRight.X, lowerRight.Y);
// shrink drawn box relative to writing box
drawnBox.Inflate(-100, -100);
// create Guide with 8 rows, zero columns, and no midline
RecognizerGuide guide = new RecognizerGuide(8, 0, 0, writingBox, drawnBox);
mRecognizerContext.Guide = guide;
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0