RecognizerGuide.WritingBox 属性

获取或设置可进行实际书写的不可见识别参考书写区。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Property WritingBox As Rectangle
用法
Dim instance As RecognizerGuide
Dim value As Rectangle

value = instance.WritingBox

instance.WritingBox = value
public Rectangle WritingBox { get; set; }
public:
property Rectangle WritingBox {
    Rectangle get ();
    void set (Rectangle value);
}
/** @property */
public Rectangle get_WritingBox()
/** @property */
public  void set_WritingBox(Rectangle value)
public function get WritingBox () : Rectangle
public function set WritingBox (value : Rectangle)

属性值

类型:System.Drawing.Rectangle
参考框的矩形书写区(以墨迹空间 坐标表示)。

备注

用户在绘制框(Tablet 屏幕上实际绘制的、供用户在其中书写的一些线条)之外书写时,书写框提供了一个误差范围。使用 DrawnBox 属性可以设置绘制框。

示例

此示例实例化 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

另请参见

参考

RecognizerGuide 结构

RecognizerGuide 成员

Microsoft.Ink 命名空间

RecognizerGuide.DrawnBox