本文整理汇总了C#中Windows.GetCurrentPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Windows.GetCurrentPoint方法的具体用法?C# Windows.GetCurrentPoint怎么用?C# Windows.GetCurrentPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows
的用法示例。
在下文中一共展示了Windows.GetCurrentPoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Zoom
public void Zoom(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
var mousePoint = e.GetCurrentPoint(null).Position;
var wheel = e.GetCurrentPoint(null).Properties.MouseWheelDelta / 120;
var zoom = Math.Exp(wheel * ZoomIntensity);
_zoom(zoom, mousePoint.X, mousePoint.Y);
}
示例2: uiElement_PointerMoved
protected virtual void uiElement_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
if (moveD3dCanvas)
{
var newPosition = e.GetCurrentPoint(null);
double deltaX = newPosition.Position.X - lastPos.Position.X;
double deltaY = newPosition.Position.Y - lastPos.Position.Y;
// Only support CompositeTransform and TranslateTransform
// Is there any better way to handle this?
if (uiElement.RenderTransform is CompositeTransform)
{
var compositeTransform = (CompositeTransform)uiElement.RenderTransform;
compositeTransform.TranslateX += deltaX;
compositeTransform.TranslateY += deltaY;
}
else if (uiElement.RenderTransform is TranslateTransform)
{
var translateTransform = (TranslateTransform)uiElement.RenderTransform;
translateTransform.X += deltaX;
translateTransform.Y += deltaY;
}
lastPos = newPosition;
}
}
示例3: DynamicArea_PointerReleased
void DynamicArea_PointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
if(_firstPoint == null)
{
return;
}
var secondPoint = e.GetCurrentPoint(null);
if(secondPoint.PointerId == _firstPoint.PointerId)
{
var deltaX = secondPoint.Position.X - _firstPoint.Position.X;
var deltaY = secondPoint.Position.Y - _firstPoint.Position.Y;
// Horizontal scrolling
if(Math.Abs(deltaX) > Math.Abs(deltaY))
{
var left = deltaX > 0;
if(left)
{
((BasicMonthViewModel)this.DataContext).ExecutePrevious(null);
}
else
{
((BasicMonthViewModel)this.DataContext).ExecuteNext(null);
}
}
}
}
示例4: OnPointerReleased
private void OnPointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
{
Windows.UI.Input.PointerPoint currentPoint = args.GetCurrentPoint(this._reference);
this._gestureRecognizer.ProcessUpEvent(currentPoint);
this._target.ReleasePointerCapture(args.Pointer);
// Mark event handled, to prevent execution of default event handlers
args.Handled = true;
}
示例5: OnPointerPressed
void OnPointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
{
// Route teh events to the gesture recognizer
this.gestureRecognizer.ProcessDownEvent(args.GetCurrentPoint(this.element));
// Set the pointer capture to the element being interacted with
this.element.CapturePointer(args.Pointer);
// Mark the event handled to prevent execution of default handlers
args.Handled = true;
}
示例6: OnPointerPressed
private void OnPointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
{
// Obtain current point in the coordinate system of the reference element
Windows.UI.Input.PointerPoint currentPoint = args.GetCurrentPoint(this._reference);
this._gestureRecognizer.ProcessDownEvent(currentPoint);
this._target.CapturePointer(args.Pointer);
args.Handled = true;
}
示例7: OnPointerPressed
public override void OnPointerPressed(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
PointerPoint point = e.GetCurrentPoint(Map);
oldMouseX = point.Position.X;
oldMouseY = point.Position.Y;
isMouseCaptured = true;
Map.CapturePointer(e.Pointer);
e.Handled = true;
base.OnPointerPressed(e);
}
示例8: EventIsSelect
public static bool EventIsSelect(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
var pointerProperties = e.GetCurrentPoint(null).Properties;
bool rval = false
|| (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen && pointerProperties.IsBarrelButtonPressed)
|| (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse && pointerProperties.IsLeftButtonPressed && e.KeyModifiers == Windows.System.VirtualKeyModifiers.Control);
return rval;
}
示例9: EventIsErase
public static bool EventIsErase(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
var pointerProperties = e.GetCurrentPoint(null).Properties;
bool rval = false
|| (pointerProperties.IsEraser)
|| (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen && !pointerProperties.IsBarrelButtonPressed && pointerProperties.IsRightButtonPressed)
|| (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse && pointerProperties.IsRightButtonPressed);
return rval;
}
示例10: OnPointerWheelChanged
private void OnPointerWheelChanged(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
{
Windows.UI.Input.PointerPoint currentPoint = args.GetCurrentPoint(this._reference);
bool shift = (args.KeyModifiers & Windows.System.VirtualKeyModifiers.Shift) == Windows.System.VirtualKeyModifiers.Shift;
bool ctrl = (args.KeyModifiers & Windows.System.VirtualKeyModifiers.Control) == Windows.System.VirtualKeyModifiers.Control;
// Route the event to the gesture recognizer
this._gestureRecognizer.ProcessMouseWheelEvent(currentPoint, shift, ctrl);
args.Handled = true;
}
示例11: OnPointerMoved
private void OnPointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
var currentPoint = e.GetCurrentPoint(MapCanvas);
HighlightedTile = ScreenToMap(
new Vector2((float)currentPoint.Position.X,
(float)currentPoint.Position.Y));
MapCanvas.Invalidate();
e.Handled = true;
}
示例12: OnPointerWheelChanged
private async void OnPointerWheelChanged(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
var point = e.GetCurrentPoint(this);
double offset = -point.Properties.MouseWheelDelta / 20.0;
double delta = -Math.Sign(offset) * 20;
for (int n = 0; n < Math.Abs(offset); n++)
{
await TranslateDelta(delta);
await Task.Delay(10);
}
}
示例13: RadialControl_PointerMoved
void RadialControl_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
if ((!IsOuterDrawing) && (!IsInnerDrawing))
return;
ClearOldStrips();
if (IsOuterDrawing)
{
_outerCurrentPoint = e.GetCurrentPoint(this).Position;
var circleStart = new Point(_startPoint.X, _startPoint.Y - OuterRingRadius);
//Calculate the angle
var angle = _mathHelper.AngleBetweenLine(_startPoint, circleStart, _outerCurrentPoint, OuterRingRadius);
var rawValue = CreateSegment(Name + "OuterRadialStrip", OuterRingRadius, _outerCurrentPoint, OuterRingColor, angle);
OuterCurrentValue = (int)(rawValue * (OuterRingMaxValue + 1));
UpdateGripControlPosition(_outerGripControl, angle, OuterRingRadius);
}
else
{
_innerCurrentPoint = new Point(e.GetCurrentPoint(this).Position.X, e.GetCurrentPoint(this).Position.Y);
var circleStart = new Point(_startPoint.X, _startPoint.Y - InnerRingRadius);
//Calculate the angle
var angle = _mathHelper.AngleBetweenLine(_startPoint, circleStart, _innerCurrentPoint, InnerRingRadius);
var rawValue = CreateSegment(Name + "InnerRadialStrip", InnerRingRadius, _innerCurrentPoint, InnerRingColor, angle);
InnerCurrentValue = (int)(rawValue * (InnerRingMaxValue + 1));
UpdateGripControlPosition(_innerGripControl, angle, InnerRingRadius);
}
}
示例14: OnPointerMoved
public override void OnPointerMoved(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
if (isMouseCaptured)
{
PointerPoint point = e.GetCurrentPoint(Map);
double newMouseX = point.Position.X;
double newMouseY = point.Position.Y;
double deltaX;
double deltaY;
deltaX = newMouseX - oldMouseX;
deltaY = newMouseY - oldMouseY;
Map.PanByPixel(-deltaX, -deltaY);
oldMouseY = point.Position.Y;
oldMouseX = point.Position.X;
}
base.OnPointerMoved(e);
}
示例15: OnPointerMoved
/// <summary>${ui_action_FrawFreeLine_event_OnPointerMoved_D}</summary>
public override void OnPointerMoved(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
if (isDrawing)
{
Point2D item = Map.ScreenToMap(e.GetCurrentPoint(Map).Position);
points.Add(item);
}
base.OnPointerMoved(e);
}