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


InkRecognizerGuide - класс

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

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

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

Синтаксис

'Декларация
Public Class InkRecognizerGuide
'Применение
Dim instance As InkRecognizerGuide
public class InkRecognizerGuide
public ref class InkRecognizerGuide
public class InkRecognizerGuide
public class InkRecognizerGuide

Заметки

The InkRecognizerGuide 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 without columns). If a user writes on the lines, instead of some arbitrary space, recognition accuracy improves. For example, letters such as "t" and "I" are more easily recognized when a guide is used to give context to the ink.

The InkRecognizerGuide specifies the boundaries where ink can be drawn by defining two rectangles; the drawn box and the writing box. The boundaries of the drawn box are visual cues, and the boundaries for the writing box are invisible. Together, they specify where writing can take place. The user normally writes within the boundaries of the visible lines of the drawn box. The drawn box is specified by the DrawnBoxTop, DrawnBoxLeft, DrawnBoxBottom, and DrawnBoxRight properties. These properties are for the recognizer's use only. Setting them does not, by itself, draw visual clues on the display. You must draw the visual clues by using the application or the control.

The writing box is larger than the drawn box and provides the users a margin of error if they draw ink outside the lines of the drawn box. The writing box is specified by the WritingBoxTop, WritingBoxLeft, WritingBoxBottom, and WritingBoxRight properties.

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 InkRecognizer object.

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

Примеры

The following sets all of the values in the InkRecognizerGuide simultaneously.

Dim guideBoxTop As Double = 0
Dim guideBoxBottom As Double = 50
Dim guideBoxLeft As Double = 0
Dim guideBoxRight As Double = 600

Dim WRITINGBOXMARGIN As Integer = 10

' Find the midline of the guide box.
Dim midline As Double = (guideBoxBottom - guideBoxTop) / 2 + guideBoxTop

theGuide.Rows = 1
theGuide.Columns = 0
theGuide.Midline = midline

theGuide.WritingBoxLeft = guideBoxLeft - WRITINGBOXMARGIN
theGuide.WritingBoxTop = guideBoxTop - WRITINGBOXMARGIN
theGuide.WritingBoxRight = guideBoxRight + WRITINGBOXMARGIN
theGuide.WritingBoxBottom = guideBoxBottom + WRITINGBOXMARGIN

theGuide.DrawnBoxLeft = guideBoxLeft
theGuide.DrawnBoxTop = guideBoxTop
theGuide.DrawnBoxRight = guideBoxRight
theGuide.DrawnBoxBottom = guideBoxBottom
double guideBoxTop = 0;
double guideBoxBottom = 50;
double guideBoxLeft = 0;
double guideBoxRight = 600;

const int WRITINGBOXMARGIN = 10;

// Find the midline of the guide box.
double midline = (guideBoxBottom - guideBoxTop) / 2 + guideBoxTop;

theGuide.Rows = 1;
theGuide.Columns = 0;
theGuide.Midline = midline;

theGuide.WritingBoxLeft = guideBoxLeft - WRITINGBOXMARGIN;
theGuide.WritingBoxTop = guideBoxTop - WRITINGBOXMARGIN;
theGuide.WritingBoxRight = guideBoxRight + WRITINGBOXMARGIN;
theGuide.WritingBoxBottom = guideBoxBottom + WRITINGBOXMARGIN;

theGuide.DrawnBoxLeft = guideBoxLeft;
theGuide.DrawnBoxTop = guideBoxTop;
theGuide.DrawnBoxRight = guideBoxRight;
theGuide.DrawnBoxBottom = guideBoxBottom;

Иерархия наследования

System.Object
  System.Windows.Ink.InkRecognizerGuide

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

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

Платформы

Windows Vista

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

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

.NET Framework

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

См. также

Ссылки

InkRecognizerGuide - члены

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

Recognizer

RecognizerContext