Gesture.Id (Propiedad)
Actualización: noviembre 2007
Obtiene el valor del movimiento de aplicación.
Espacio de nombres: Microsoft.Ink
Ensamblado: Microsoft.Ink (en Microsoft.Ink.dll)
Sintaxis
'Declaración
Public ReadOnly Property Id As ApplicationGesture
'Uso
Dim instance As Gesture
Dim value As ApplicationGesture
value = instance.Id
public ApplicationGesture Id { get; }
public:
property ApplicationGesture Id {
ApplicationGesture get ();
}
/** @property */
public ApplicationGesture get_Id()
public function get Id () : ApplicationGesture
Valor de propiedad
Tipo: Microsoft.Ink.ApplicationGesture
Valor del movimiento de aplicación.
Comentarios
Nota
Un identificador de un objeto Gesture es constante a lo largo del tiempo, es decir, no cambia nunca.
Dado que cada movimiento de aplicación existe como un valor en la enumeración ApplicationGesture, el valor actúa como el identificador de dicho movimiento.
Ejemplos
En este ejemplo se desencadena un controlador de eventos cuando se reconoce un movimiento de aplicación. Solo desencadenarán el evento los tipos ApplicationGesture solicitados específicamente por la aplicación (llamando al método SetGestureStatus). Al examinar el primer objeto Gesture pasado al controlador de eventos, si la propiedad Confidence está establecida en un nivel de confianza alto para un movimiento Check, se dibuja un círculo pequeño alrededor de las coordenadas que representa la propiedad HotPoint.
' event handler for InkOverlay.Gesture event
Private Sub mInkObject_Gesture(ByVal sender As Object, ByVal e As InkCollectorGestureEventArgs)
' There might be more than one gesture passed in InkCollectorGestureEventArgs
' 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 first gesture has RecognitionConfidence.Strong
Dim G As Gesture = e.Gestures(0)
' if this is ApplicationGesture.Check of RecognitionConfidence.Strong confidence
If ApplicationGesture.Check = G.Id And RecognitionConfidence.Strong = G.Confidence Then
Dim mInkOverlay As InkOverlay = DirectCast(sender, InkOverlay)
' assuming here that InkOverlay.AttachedControl property is set.
' This can be set with the .ctor InkOverlay(Control C) or the
' InkOverlay.AttachedControl property can be set later.
Using GR As Graphics = mInkOverlay.AttachedControl.CreateGraphics()
' get the hot point
Dim hotPoint As Point = G.HotPoint
' convert to pixel coordinates
mInkOverlay.Renderer.InkSpaceToPixel(GR, hotPoint)
' draw a small circle
GR.DrawEllipse(Pens.Orange, hotPoint.X - 6, hotPoint.Y - 6, 12, 12)
' cancel the event. This prevents the gesture from disappearing
' and lets you see the small circle and the gesture together
e.Cancel = True
End Using
End If
End Sub
// event handler for InkOverlay.Gesture event
private void mInkObject_Gesture(object sender, InkCollectorGestureEventArgs e)
{
// There might be more than one gesture passed in InkCollectorGestureEventArgs
// 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 first gesture has RecognitionConfidence.Strong
Gesture G = e.Gestures[0];
// if this is ApplicationGesture.Check of RecognitionConfidence.Strong confidence
if (ApplicationGesture.Check == G.Id && RecognitionConfidence.Strong == G.Confidence)
{
InkOverlay mInkOverlay = (InkOverlay)sender;
// assuming here that InkOverlay.AttachedControl property is set.
// This can be set with the .ctor InkOverlay(Control C) or the
// InkOverlay.AttachedControl property can be set later.
using (Graphics GR = mInkOverlay.AttachedControl.CreateGraphics())
{
// get the hot point
Point hotPoint = G.HotPoint;
// convert to pixel coordinates
mInkOverlay.Renderer.InkSpaceToPixel(GR, ref hotPoint);
// draw a small circle
GR.DrawEllipse(Pens.Orange, hotPoint.X - 6, hotPoint.Y - 6, 12, 12);
// cancel the event. This prevents the gesture from disappearing
// and lets you see the small circle and the gesture together
e.Cancel = true;
}
}
}
Plataformas
Windows Vista
.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Información de versión
.NET Framework
Compatible con: 3.0