本文整理汇总了C#中System.Windows.Input.TouchEventArgs.GetTouchPoint方法的典型用法代码示例。如果您正苦于以下问题:C# TouchEventArgs.GetTouchPoint方法的具体用法?C# TouchEventArgs.GetTouchPoint怎么用?C# TouchEventArgs.GetTouchPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Input.TouchEventArgs
的用法示例。
在下文中一共展示了TouchEventArgs.GetTouchPoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button_PreviewTouchDown
private void Button_PreviewTouchDown(object sender, TouchEventArgs e)
{
if (touch1 == null)
{
touch1 = e.GetTouchPoint(sender as SurfaceButton);
}
else
{
touch2 = e.GetTouchPoint(sender as SurfaceButton);
initialDist = touchDist(touch1, touch2);
}
}
示例2: HandleTouch
private void HandleTouch(TouchEventArgs e)
{
var visual = GetTouchVisual(e.TouchDevice.Id);
var point = e.GetTouchPoint(this.fingerCanvas).Position;
visual.SetValue(Canvas.LeftProperty, point.X);
visual.SetValue(Canvas.TopProperty, point.Y);
}
示例3: OnTouchMove
private void OnTouchMove(object sender, TouchEventArgs e)
{
if (!_AlreadySwiped)
{
var touch = e.GetTouchPoint(_ParentControl);
//right now a swipe is 200 pixels
//Swipe Left
if (_TouchStart != null && touch.Position.X > (_TouchStart.Position.X + 200))
{
if (OnSwipeLeft != null)
OnSwipeLeft(sender, e);
_AlreadySwiped = true;
StartTimer();
}
//Swipe Right
if (_TouchStart != null && touch.Position.X < (_TouchStart.Position.X - 200))
{
if (OnSwipeRight != null)
OnSwipeRight(sender, e);
_AlreadySwiped = true;
StartTimer();
}
}
//e.Handled = true;
}
示例4: RecordTouchDown
private void RecordTouchDown(object sender, TouchEventArgs e)
{
_touchPoints++;
_recordRotation = true;
System.Windows.Input.TouchPoint touchPoint = e.GetTouchPoint(this);
System.Windows.Point point = touchPoint.Position;
_recordY = point.Y;
if (_touchPoints == 2)
{
if (!_isPlaying)
{
channel.PlaySample();
_isPlaying = true;
}
else
{
channel.StopSample();
_isPlaying = false;
}
_twoTouchLock = true;
}
if (_touchPoints == 1)
{
if (channel.IsPlaying())
channel.Pause();
}
}
示例5: LessonContainer_TouchDown
private async void LessonContainer_TouchDown(object sender, TouchEventArgs e)
{
// Forward touch events to container
//FrameworkElement control = sender as FrameworkElement;
//control.CaptureTouch(e.TouchDevice);
if (LayerStackDC.CurrentState.FingerInkingEnabled)
{
LessonContainer.IsContentManipulationEnabled = false;
return;
}
// Saves current touch information
//touchDevices.Add(e.TouchDevice);
touchOrigin = e.GetTouchPoint(LessonContainer).Position;
// Disable manipulation/drawing
//LessonContainer.IsContentManipulationEnabled = false;
LayerStackDC.ContainerTouchDown();
// If touch-and-hold (within 10px radius circle, over 500ms)
if (await TouchHelper.TouchHold(e, LessonContainer, 500, 10))
{
// Opens RadialMenu
LessonContainer.IsContentManipulationEnabled = false;
LayerStackDC.OpenRadialMenu(LayerStackDC.Viewport.GetViewport(),
e.GetTouchPoint(LessonContainer).Position, RadialMenuState.Levels.Main);
// Un-forward touch events to container
//control.ReleaseAllTouchCaptures();
}
}
示例6: OnTouchDown
} //
public void OnTouchDown(object xSender, TouchEventArgs e)
{
Canvas lCanvas = xSender as Canvas;
if (lCanvas == null) return;
TouchPoint lTouchPoint = e.GetTouchPoint(lCanvas);
if (lTouchPoint == null) return;
myTuple lTuple = _PointA;
if (lTuple != null)
{
if (lTuple.Item1 == e.TouchDevice.Id) return; // this was finger 1, not going to happen anyway as it cannot touchdown twice
Point lPointA = lTuple.Item2;
// store second finger; we don't care about its ID, so it could also be finger 3, 4 or 5 ...
Point lPointB = lTouchPoint.Position;
_PointB = new myTuple(e.TouchDevice.Id, lPointB);
RedrawRectangle(lPointA, lPointB);
return;
}
// first finger
DrawNewRectangle(lCanvas, lTouchPoint.Position, lTouchPoint.TouchDevice.Id);
return;
} //
示例7: SurfaceWindow_TouchDown
private void SurfaceWindow_TouchDown(object sender, TouchEventArgs e)
{
//test
Ellipse handRange = new Ellipse();
handRange.Fill = System.Windows.Media.Brushes.DeepPink;
handRange.Width = 100;
handRange.Height = 100;
TranslateTransform Pos = new TranslateTransform();
Pos.X = (int)e.GetTouchPoint(this).Position.X;//-this.Width/2;
Pos.Y = (int)e.GetTouchPoint(this).Position.Y;//-this.Height/2;
handRange.RenderTransform = null;
handRange.RenderTransform = Pos;
// HandRange.
DrawingCanvas.Children.Add(handRange);
//testover
int X = (int)e.GetTouchPoint(this).Position.X;
int Y = (int)e.GetTouchPoint(this).Position.Y;
watchingWindow.getHands((int)this.Width, (int)this.Height);
Console.Out.WriteLine(watchingWindow.GetUser(X, Y, (int)this.Width, (int)this.Height));
Dictionary<String, System.Drawing.Point> Hands = watchingWindow.getHands(WindowsWidth, WindowsHeight);
foreach (KeyValuePair<String, System.Drawing.Point> pair in Hands)
{
System.Drawing.Point HandPoint = pair.Value;
String HandString = pair.Key;
//Console.Out.WriteLine("Hand in " + HandPoint.X + " , " + HandPoint.Y);
if (HandPoint.X != 0 && HandPoint.Y != 0)
if (HandPoint.X < (int)this.Width && HandPoint.Y < (int)this.Height)
{
Ellipse HandRange = new Ellipse();
HandRange.Fill = System.Windows.Media.Brushes.DarkBlue;
HandRange.Width = 100;
HandRange.Height = 100;
TranslateTransform pos = new TranslateTransform();
pos.X = HandPoint.X;//-this.Width/2;
pos.Y = HandPoint.Y;// -this.Height / 2;
HandRange.RenderTransform = null;
HandRange.RenderTransform = pos;
// HandRange.
DrawingCanvas.Children.Add(HandRange);
Console.Out.WriteLine(HandString+" in " + HandPoint.X + " , " + HandPoint.Y);
}
}
}
示例8: layoutRoot_TouchDown
public void layoutRoot_TouchDown(object sender, TouchEventArgs e)
{
TouchPoint p = e.GetTouchPoint(GestureFramework.LayoutRoot);
TouchInfo info = p.ToTouchInfo();
UIElement source = e.OriginalSource as UIElement;
base.AddNewTouchPoint(info, source);
}
示例9: OnPreviewTouchDown
protected override void OnPreviewTouchDown(TouchEventArgs e)
{
//오브젝트 선택
TouchPoint pt = e.GetTouchPoint(this);
this.HitTestHelper.SelectItemAt(pt.Position);
base.OnPreviewTouchDown(e);
}
示例10: Slider_TouchDown
private void Slider_TouchDown(object sender, TouchEventArgs e)
{
VisualStateManager.GoToState((FrameworkElement)sender, "Pressed", true);
var slider = (Slider)sender;
slider.SetPositionByControlPoint(e.GetTouchPoint(slider).Position);
slider.CaptureTouch(e.TouchDevice);
e.Handled = true;
}
示例11: canvas_TouchMove
private void canvas_TouchMove(object sender, TouchEventArgs e)
{
// Get the ellipse that corresponds to the current touch-down.
Ellipse ellipse = movingEllipses[e.TouchDevice.Id];
// Move it to the new touch-down point.
TouchPoint touchPoint = e.GetTouchPoint(canvas);
Canvas.SetTop(ellipse, touchPoint.Bounds.Top);
Canvas.SetLeft(ellipse, touchPoint.Bounds.Left);
}
示例12: OnTouchUp
protected override void OnTouchUp(TouchEventArgs e)
{
TouchPoint point = e.GetTouchPoint(card.CardControler.MainWindow.CardLayer);
card.CardControler.MainWindow.TouchControler.TouchUp(e.TouchDevice, point);
card.CardControler.MainWindow.ControlWindow.UpdateTextInfo(card.CardControler.MainWindow.TouchControler.ToString(), 1);
Matrix mtx = (this.RenderTransform as MatrixTransform).Matrix;
mtx.ScaleAt(1.0 / 1.5, 1.0 / 1.5, this.Width / 2, -STATICS.DEAULT_CARD_SIZE.Height + this.Height / 2);
this.RenderTransform = new MatrixTransform(mtx);
e.Handled = true;
base.OnTouchUp(e);
}
示例13: OnTouchMove
protected override void OnTouchMove(TouchEventArgs e)
{
TouchPoint point = e.GetTouchPoint(card.CardControler.MainWindow.CardLayer);
card.CardControler.MainWindow.TouchControler.TouchMove(this, this.GetType(), e.TouchDevice, point);
if (STATICS.DEBUG_MODE)
{
card.CardControler.MainWindow.ControlWindow.UpdateTextInfo(card.CardControler.MainWindow.TouchControler.ToString(), 1);
}
e.Handled = true;
base.OnTouchMove(e);
}
示例14: IsDoubleTap
public bool IsDoubleTap(TouchEventArgs e)
{
Point currentTapPosition = e.GetTouchPoint(_ParentControl).Position;
bool tapsAreCloseInDistance = GetDistanceBetweenPoints(currentTapPosition, _LastTapLocation) < 40;
_LastTapLocation = currentTapPosition;
TimeSpan elapsed = _DoubleTapStopwatch.Elapsed;
_DoubleTapStopwatch.Restart();
bool tapsAreCloseInTime = (elapsed != TimeSpan.Zero && elapsed < TimeSpan.FromSeconds(0.7));
return tapsAreCloseInDistance && tapsAreCloseInTime;
}
示例15: OnTouchDown
protected override void OnTouchDown(TouchEventArgs e)
{
this.CaptureTouch(e.TouchDevice);
TouchPoint point = e.GetTouchPoint(card.CardControler.MainWindow.CardLayer);
card.CardControler.MainWindow.TouchControler.TouchDown(this, this.GetType(), e.TouchDevice.Id, point);
Matrix mtx = (this.RenderTransform as MatrixTransform).Matrix;
mtx.ScaleAt(1.5, 1.5, this.Width / 2, this.Height / 2);
this.RenderTransform = new MatrixTransform(mtx);
card.CardControler.MainWindow.ControlWindow.UpdateTextInfo(card.CardControler.MainWindow.TouchControler.ToString(), 1);
e.Handled = true;
base.OnTouchMove(e);
}