RecognizerGuide.DrawnBox 属性
获取或设置在 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