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


RecognizerGuide - структура

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

Represents the area that the Recognizer object uses and in which ink can be drawn. The area is known as the recognizer guide.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Structure RecognizerGuide
'Применение
Dim instance As RecognizerGuide
public struct RecognizerGuide
public value class RecognizerGuide
public final class RecognizerGuide extends ValueType
JScript поддерживает использование структур, но не объявление новых структур.

Заметки

The recognizer guide can consist of rows and columns, and gives the recognizer a better context in which to perform recognition. For example, you can draw horizontal lines on a user's screen, almost like a ruled piece of paper, that show where inking should occur (this type of guide would consist only of rows, and no columns). If a user writes on the lines, instead of some arbitrary space, recognition accuracy improves. For illustrations of recognizer guides, see Ink Recognition.

Letters such as "t" and "I" are more easily recognized when a guide is used to give context to the ink.

The guide specifies the boundaries of the ink in ink space coordinates. The DrawnBox property can define a box which is the same size as or smaller than the box defined by the WritingBox property. This allows for disparate writing styles. If the user writes outside the DrawnBox but within the WritingBox, the Recognizer object uses all of the ink to aid in recognition.

If the application has drawn guidelines on the screen on which the user is expected to write, the application should set the values of the properties of the recognizer guide to inform the recognizer. These properties are for the recognizer's use only. Setting them does not, by itself, draw visual clues on the display. The application or the control draws the visual clues.

In addition to drawing lines, or rules, on the screen that show users where to write, it is also possible to draw cells on the screen in which characters or words are written. This is called boxed input and is useful with some East Asian languages. To determine if the recognizer is capable of boxed input, call the Capabilities property of the Recognizer object.

By default, there is no guide. A default guide has all property values set to 0. You must use the properties of this object to set the guide.

Примеры

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;
}

Потокобезопасность

Любые открытые члены этого типа, объявленные как static (Shared в Visual Basic), являются потокобезопасными. Потокобезопасность членов экземпляров не гарантируется.

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

RecognizerGuide - члены

Microsoft.Ink - пространство имен

Recognizer

RecognizerContext