本文整理汇总了C#中Windows.UI.Xaml.Input.PointerRoutedEventArgs.GetIntermediatePoints方法的典型用法代码示例。如果您正苦于以下问题:C# PointerRoutedEventArgs.GetIntermediatePoints方法的具体用法?C# PointerRoutedEventArgs.GetIntermediatePoints怎么用?C# PointerRoutedEventArgs.GetIntermediatePoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Input.PointerRoutedEventArgs
的用法示例。
在下文中一共展示了PointerRoutedEventArgs.GetIntermediatePoints方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawingBoard_PointerMoved
private void DrawingBoard_PointerMoved(object sender, PointerRoutedEventArgs e)
{
lock (_renderer)
{
_renderer.OnPointerMoved(e.GetIntermediatePoints(DrawingControl));
}
DrawingControl.Invalidate();
}
示例2: OnPointerPressed
void OnPointerPressed(object sender, PointerRoutedEventArgs e)
{
var ps = e.GetIntermediatePoints(null);
if (ps != null && ps.Count > 0)
{
_holdObj = sender;
gestRec.ProcessDownEvent(ps[0]);
e.Handled = true;
}
}
示例3: OnPointerReleased
void OnPointerReleased(object sender, PointerRoutedEventArgs e)
{
var ps = e.GetIntermediatePoints(null);
if (ps != null && ps.Count > 0)
{
gestRec.ProcessUpEvent(ps[0]);
e.Handled = true;
gestRec.CompleteGesture();
_holdObj = null;
}
}
示例4: foreach
private void canvas右邊手寫畫板_PointerMoved(object sender, PointerRoutedEventArgs e)
{
if (this.正在手寫中 == false)
{
return;
}
if (e.Pointer.PointerId == PenID || e.Pointer.PointerId == TouchID)
{
foreach (PointerPoint pointerPoint in e.GetIntermediatePoints(this.canvas右邊手寫畫板).Reverse())
{
CurrentContactPoint = pointerPoint.Position;
X1 = PreviousContactPoint.X;
Y1 = PreviousContactPoint.Y;
X2 = CurrentContactPoint.X;
Y2 = CurrentContactPoint.Y;
if (this.使用中的繪圖工具.手或筆與橡皮擦 == 手或筆與橡皮擦.筆)
{
手寫物件軌跡_右.手寫物件s.Add(new 手寫物件()
{
//X1 = LastX,
X1 = X1,
X2 = X2,
//Y1 = LastY,
Y1 = Y1,
Y2 = Y2,
});
}
else
{
手寫物件軌跡_右.手寫物件s.Add(new 手寫物件()
{
X1 = X1,
X2 = X2,
Y1 = Y1,
Y2 = Y2,
});
}
//LastX = CurrentContactPoint.X;
//LastY = CurrentContactPoint.Y;
PreviousContactPoint = CurrentContactPoint;
}
Redraw右邊手寫板();
}
}
示例5: OnPointerMoved
void OnPointerMoved(object sender, PointerRoutedEventArgs e)
{
_holdObj = sender;
gestRec.ProcessMoveEvents(e.GetIntermediatePoints(null));
e.Handled = true;
}
示例6: OnPointerMoved
// Route the pointer moved event to the gesture recognizer.
// The points are in the reference frame of the canvas that contains the rectangle element.
void OnPointerMoved(object sender, PointerRoutedEventArgs args)
{
// Feed the set of points into the gesture recognizer as a move event
recognizer.ProcessMoveEvents(args.GetIntermediatePoints(reference));
}
示例7: Canvas_PointerMoved
void Canvas_PointerMoved(object sender, PointerRoutedEventArgs e)
{
if (editingRegion == null)
return;
// Add points to the edit region.
regionPoints.AddRange(from point in e.GetIntermediatePoints(canvas)
select ConvertDipsToPixels(point));
canvas.Invalidate();
e.Handled = true;
}
示例8: page_PointerMoved
static void page_PointerMoved(object sender, PointerRoutedEventArgs e)
{
_gr.ProcessMoveEvents(e.GetIntermediatePoints(null));
e.Handled = true;
if (OnGestureRaised != null) OnGestureRaised(sender, new CustomGestureArgs() { MovedPointerRoutedEventArgs = e });
}
示例9: ProcessPointerInput
// Toggles the color of cells when they are clicked on.
private void ProcessPointerInput(PointerRoutedEventArgs e)
{
if (!isPointerDown)
return;
// Invert the display transform, to convert pointer positions into simulation rendertarget space.
Matrix3x2 transform;
Matrix3x2.Invert(GetDisplayTransform(canvas), out transform);
foreach (var point in e.GetIntermediatePoints(canvas))
{
if (!point.IsInContact)
continue;
var pos = Vector2.Transform(point.Position.ToVector2(), transform);
var x = canvas.ConvertDipsToPixels(pos.X, CanvasDpiRounding.Floor);
var y = canvas.ConvertDipsToPixels(pos.Y, CanvasDpiRounding.Floor);
// If the point is within the bounds of the rendertarget, and not the same as the last point...
if (x >= 0 &&
y >= 0 &&
x < simulationW &&
y < simulationH &&
((x != lastPointerX || y != lastPointerY)))
{
// We avoid manipulating GPU resources from inside an input event handler
// (since we'd need to handle device lost and possible concurrent running with CreateResources).
// Instead, we collect up a list of points and process them from the Draw handler.
hitPoints.Add(new IntPoint(x, y));
lastPointerX = x;
lastPointerY = y;
}
}
canvas.Invalidate();
}
示例10: OnPointerMoved
void OnPointerMoved(
object sender,
PointerRoutedEventArgs e)
{
_gr.ProcessMoveEvents(
e.GetIntermediatePoints(_window));
PointerPoint pointer =
e.GetCurrentPoint(_window);
if (_pointers.ContainsKey(pointer.PointerId))
_pointers[pointer.PointerId] = pointer;
switch (_pointerMode)
{
case PointerMode.kBeginDragMode:
_previousPointerPos =
pointer.Position;
_pointerMode = PointerMode.kDragMode;
break;
case PointerMode.kDragMode:
double xOffset =
_previousPointerPos.X -
pointer.Position.X;
double yOffset =
_previousPointerPos.Y -
pointer.Position.Y;
_dragDistance += GetDistance(
_previousPointerPos,
pointer.Position);
_previousPointerPos =
pointer.Position;
_renderer.Rotate(
(float)xOffset,
(float)yOffset);
break;
case PointerMode.kScaleMode:
var pointers =
_pointers.Values.ToList();
double dist = GetDistance(
ToDeviceCoordinate(pointers[0].RawPosition),
ToDeviceCoordinate(pointers[1].RawPosition));
double accZoom =
_accumulator.Accumulate(dist);
_renderer.SetZoom((float)accZoom * 5.0f / 1000.0f);
break;
case PointerMode.kIdleMode:
Point pos = ToDeviceCoordinate(
pointer.RawPosition);
_renderer.CheckPreSelection(
(float)pos.X,
(float)pos.Y);
break;
default:
break;
}
}
示例11: OnPointerMoved
private void OnPointerMoved(object sender, PointerRoutedEventArgs e)
{
_gr.ProcessMoveEvents(e.GetIntermediatePoints(null));
e.Handled = true;
}
示例12: Element_PointerMoved
private void Element_PointerMoved(object sender, PointerRoutedEventArgs e)
{
this.gestureRecognizer.ProcessMoveEvents(e.GetIntermediatePoints(this.element));
}
示例13: OnPointerMoved
void OnPointerMoved(object sender, PointerRoutedEventArgs args)
{
// Pass all intermediate points to the gesture recognizer.
recognizer.ProcessMoveEvents(args.GetIntermediatePoints(Rect1));
}
示例14: OnPointerMoved
private void OnPointerMoved(object sender, PointerRoutedEventArgs args)
{
Gesture.ProcessMoveEvents(args.GetIntermediatePoints(this.Parent as UIElement));
args.Handled = true;
}
示例15: GestureRecognizerDemo_PointerMoved
private void GestureRecognizerDemo_PointerMoved(object sender, PointerRoutedEventArgs e)
{
// 告诉 GestureRecognizer 指针移动中,以便 GestureRecognizer 做手势监测
_gestureRecognizer.ProcessMoveEvents(e.GetIntermediatePoints(null));
}