取得或設定矩形,這個矩形是實際繪製在 Tablet 螢幕上而且是書寫所在的矩形。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public Property DrawnBox As Rectangle
'用途
Dim instance As RecognizerGuide
Dim value As Rectangle
value = instance.DrawnBox
instance.DrawnBox = value
public Rectangle DrawnBox { get; set; }
public:
property Rectangle DrawnBox {
Rectangle get ();
void set (Rectangle value);
}
/** @property */
public Rectangle get_DrawnBox()
/** @property */
public void set_DrawnBox(Rectangle value)
public function get DrawnBox () : Rectangle
public function set DrawnBox (value : Rectangle)
屬性值
型別:System.Drawing.Rectangle
實際繪製在 Tablet 螢幕上而且是書寫所在的矩形,它與書寫方塊的左上角相對。
備註
繪製方塊的行是視覺線索,可指定書寫的所在位置。使用者通常會在各行界限內書寫。
另一個矩形 (即書寫方塊) 是實際上會發生書寫的不可見的方塊。它大於繪製方塊,而且如果使用者在繪製方塊的行以外繪製筆墨,則會為使用者提供錯誤的邊界。請使用 WritingBox 屬性設定書寫方塊。
書寫方塊會為辨識器指定筆墨的界限。繪製方塊的繪製是使用筆墨空間座標,它與書寫方塊的左上角相對。
範例
在這個範例中,會具現化 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