업데이트: 2007년 11월
인식기에서 신뢰 수준 순서대로 나열된 Gesture 개체의 배열을 가져옵니다.
네임스페이스: Microsoft.Ink
어셈블리: Microsoft.Ink(Microsoft.Ink.dll)
구문
‘선언
Public ReadOnly Property Gestures As Gesture()
‘사용 방법
Dim instance As InkEditGestureEventArgs
Dim value As Gesture()
value = instance.Gestures
public Gesture[] Gestures { get; }
public:
property array<Gesture^>^ Gestures {
array<Gesture^>^ get ();
}
/** @property */
public Gesture[] get_Gestures()
public function get Gestures () : Gesture[]
속성 값
형식: array<Microsoft.Ink.Gesture[]
인식기에서 신뢰 수준 순서대로 나열된 Gesture 개체의 배열입니다.
설명
응용 프로그램 제스처에 대한 설명은 ApplicationGesture 열거형을 참조하십시오.
Gesture 이벤트는 인식기에서 응용 프로그램 제스처를 인식하는 경우에 발생합니다.
배열에는 시스템 제스처가 아닌 응용 프로그램 제스처에 대한 정보가 들어 있습니다. 제스처에 대한 자세한 내용은 Using Gestures을를 참조하십시오.
InkEdit 컨트롤에는 다음 제스처에 대한 기본 관심도와 동작이 지정되어 있습니다.
제스처 |
동작 |
|---|---|
왼쪽 아래, 왼쪽 아래로 길게 |
Enter |
오른쪽 |
Space |
왼쪽 |
Backspace |
오른쪽 위, 오른쪽 위로 길게 |
Tab |
예제
이 예제에서는 Gesture 이벤트 및 Stroke 이벤트에 대한 알림을 신청하여 ApplicationGesture의 기능을 확장하는 방법을 보여 줍니다.
Gesture 이벤트가 발생하면 InkEdit 컨트롤의 제스처와 현재 상태를 조사합니다. 필요한 경우 제스처의 동작이 수정되고 이벤트가 취소됩니다.
Private Sub mInkEdit_Gesture(ByVal sender As Object, ByVal e As InkEditGestureEventArgs)
' There might be more than one gesture passed in InkEditGestureEventArgs
' The gestures are arranged in order of confidence from most to least
' This event handler is only concerned with the first (most confident) gesture
' and only if the gesture is ApplicationGesture.Left with strong confidence
Dim G As Gesture = e.Gestures(0)
If (ApplicationGesture.Left = G.Id And RecognitionConfidence.Strong = G.Confidence) Then
Dim pInkEdit As InkEdit = DirectCast(sender, InkEdit)
' by default, ApplicationGesture.Left maps to Backspace
' If the insertion point is at the beginning of the text
' and there is no text selected, then Backspace does not do anything.
' In this case, we will alter the gesture to map to Delete instead
If (0 = pInkEdit.SelectionStart And 0 = pInkEdit.SelectionLength And pInkEdit.Text.Length > 0) Then
' take out the first character of the string
pInkEdit.Text = pInkEdit.Text.Remove(0, 1)
' save the stroke ID in a class level var for use in the Stroke event
Me.mStrokeID = e.Strokes(0).Id
' cancel the gesture so it won't perform the default action
e.Cancel = True
End If
End If
End Sub
private void mInkEdit_Gesture(object sender, InkEditGestureEventArgs e)
{
// There might be more than one gesture passed in InkEditGestureEventArgs
// The gestures are arranged in order of confidence from most to least
// This event handler is only concerned with the first (most confident) gesture
// and only if the gesture is ApplicationGesture.Left with strong confidence
Gesture G = e.Gestures[0];
if (ApplicationGesture.Left == G.Id && RecognitionConfidence.Strong == G.Confidence)
{
InkEdit pInkEdit = (InkEdit)sender;
// by default, ApplicationGesture.Left maps to Backspace
// If the insertion point is at the beginning of the text
// and there is no text selected, then Backspace does not do anything.
// In this case, we will alter the gesture to map to Delete instead
if (0 == pInkEdit.SelectionStart && 0 == pInkEdit.SelectionLength && pInkEdit.Text.Length > 0)
{
// take out the first character of the string
pInkEdit.Text = pInkEdit.Text.Remove(0, 1);
// save the stroke ID in a class level var for use in the Stroke event
this.mStrokeID = e.Strokes[0].Id;
// cancel the gesture so it won't perform the default action
e.Cancel = true;
}
}
}
Stroke 이벤트가 발생하면 해당 스트로크가 Gesture 이벤트에서 동작이 수정된 제스처를 생성하는 데 사용된 경우 이벤트가 취소됩니다. 이렇게 하면 스트로크가 렌더링되지 않습니다.
Private Sub mInkEdit_Stroke(ByVal sender As Object, ByVal e As InkEditStrokeEventArgs)
e.Cancel = (e.Stroke.Id = Me.mStrokeID)
End Sub
private void mInkEdit_Stroke(object sender, InkEditStrokeEventArgs e)
{
e.Cancel = (e.Stroke.Id == this.mStrokeID);
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원