1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| using Windows7.Multitouch;
using Windows7.Multitouch.WPF;
namespace WpfTouchGesture
{
public partial class Window1 : Window
{
private readonly Windows7.Multitouch.GestureHandler _gestureHandler;
public Window1()
{
InitializeComponent();
_gestureHandler = Factory.CreateGestureHandler(this);
_gestureHandler.Zoom += ProcessZoom;
_gestureHandler.ZoomBegin += ProcessZoom;
_gestureHandler.ZoomEnd += ProcessZoom;
}
private void ProcessZoom(object sender, GestureEventArgs args)
{
scale.ScaleX *= args.ZoomFactor;
scale.ScaleY *= args.ZoomFactor;
GestureTextBlock.Text = string.Format("Zooming ScaleX:{0}, ScaleY:{1}", scale.ScaleX, scale.ScaleY);
}
}
} |
Partager