Поделиться через


RecognizerGuide.DrawnBox - свойство

Обновлен: Ноябрь 2007

Gets or sets the rectangle that is physically drawn on the tablet screen and in which writing takes place.

Пространство имен:  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
The rectangle that is physically drawn on the tablet screen and in which writing takes place, relative to the top left of the writing box.

Заметки

The lines of the drawn box are visual cues that specify where writing can take place. The user normally writes within the boundaries of the lines.

Another rectangle, the writing box, is the invisible box in which writing can actually take place. It is larger than the drawn box and provides a margin of error to users if they draw ink outside the lines of the drawn box. Use the WritingBox property to set the writing box.

The writing box specifies the boundaries of the ink to the recognizer. The drawn box is drawn using ink space coordinates, relative to the top left of the writing box.

Примеры

In this example, a RecognizerContext object is instantiated, and the Guide property assigned by creating a new RecognizerGuide object.

' 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.WritingBox