protected override void OnStylusDown(StylusDownEventArgs e) { base.OnStylusDown(e); StylusPointCollection points = e.GetStylusPoints(this); InitializeEraserHitTester(points); }
protected override void OnStylusDown(StylusDownEventArgs e) { base.OnStylusDown(e); // TJC: only take in stylus ink, not multitouch bool isStylus = e.StylusDevice.Id == MyRend.STYLUS_ID || e.StylusDevice.StylusButtons.Count == 2; // tip and barrel if (!isStylus) { _touchCount++; if (_touchCount > _maxTouches) { _maxTouches = _touchCount; } //System.Console.WriteLine("DOWN TC: " + _touchCount + " " + _maxTouches); //if (_touchCount > 0) return; // don't capture ink if more than one touch // TJC TEST } if (InkEnabled) { _stylusPoints = new StylusPointCollection(); // Capture the stylus so all stylus input is routed to this control. Stylus.Capture(this); _stylusPoints.Add(e.GetStylusPoints(this, _stylusPoints.Description)); } }
private void image1_StylusDown(object sender, StylusDownEventArgs e) { Point pt = e.GetPosition(image1); StylusPointCollection sp = e.GetStylusPoints(image1); DrawStart(pt, sp[0].PressureFactor); e.Handled = true; }
private void DrawingCanvas_StylusDown(object sender, StylusDownEventArgs e) { stylusPoints = new StylusPointCollection(); StylusPointCollection eventPoints = e.GetStylusPoints(this, stylusPoints.Description); stylusPoints.Add(eventPoints); }
protected override void OnStylusDown(StylusDownEventArgs e) { base.OnStylusDown(e); stylusPoints = new StylusPointCollection(); stylusPoints.Add(e.GetStylusPoints(this, stylusPoints.Description)); }
protected override void OnStylusDown(StylusDownEventArgs e) { Stylus.Capture(this); StylusPointCollection newStylusPoints = e.GetStylusPoints(this); stylusPoints = new StylusPointCollection(newStylusPoints.Description); stylusPoints.Add(newStylusPoints); }
private void OnStylusDown(object sender, StylusDownEventArgs e) { if (!this.IsTouchNavigationEnabled) { return; } _downPoints = e.GetStylusPoints(sender as IInputElement); this.ShowNavigationButtons = false; }
protected override void OnStylusDown(StylusDownEventArgs e) { Stylus.Capture(this); //Get the StylusPoints that have come in so far StylusPointCollection newStylusPoints = e.GetStylusPoints(this); // Allocate memory for the StylusPointsCollection and // add the StylusPoints that have come in so far //stylusPoints = new StylusPointCollection(newStylusPoints.Description); //stylusPoints.Add(newStylusPoints); //Create a new StylusPointCollection using the StylusPointDescription //from the stylus points in the StylusDownEventArgs. stylusPoints = new StylusPointCollection(); StylusPointCollection eventPoints = e.GetStylusPoints(this, stylusPoints.Description); stylusPoints.Add(eventPoints); }
protected override void OnStylusDown(StylusDownEventArgs e) { base.OnStylusDown(e); StylusPointCollection eventPoints = e.GetStylusPoints(this); // Create a new StylusPointCollection using the StylusPointDescription // from the stylus points in the StylusDownEventArgs. stylusPoints = new StylusPointCollection(eventPoints.Description, eventPoints.Count); stylusPoints.Add(eventPoints); }
private void MTxtClickHere_StylusDown(object sender, StylusDownEventArgs e) { var point = e.GetStylusPoints((IInputElement)sender).First(); List <string> available_properties = new List <string>(); foreach (var prop in point.Description.GetStylusPointProperties()) { available_properties.Add($"{prop.ToString()} => {point.GetPropertyValue(prop)}"); } mListView.ItemsSource = available_properties; }
//</Snippet5> //<Snippet6> //<Snippet4> // Prepare to collect stylus packets. Get the // IncrementalHitTester from the InkPresenter's // StrokeCollection and subscribe to its StrokeHitChanged event. protected override void OnStylusDown(StylusDownEventArgs e) { base.OnStylusDown(e); EllipseStylusShape eraserTip = new EllipseStylusShape(3, 3, 0); eraseTester = presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip); eraseTester.StrokeHit += new StrokeHitEventHandler(eraseTester_StrokeHit); eraseTester.AddPoints(e.GetStylusPoints(this)); }
//<Snippet7> protected override void OnStylusDown(StylusDownEventArgs e) { // Capture the stylus so all stylus input is routed to this control. Stylus.Capture(this); // Allocate memory for the StylusPointsCollection and // add the StylusPoints that have come in so far. stylusPoints = new StylusPointCollection(); StylusPointCollection eventPoints = e.GetStylusPoints(this, stylusPoints.Description); stylusPoints.Add(eventPoints); }
//<Snippet13> void inkCanvas1_StylusDown(object sender, StylusDownEventArgs e) { StylusPointCollection points = e.GetStylusPoints(inkCanvas1); Point firstPoint = (Point)points[0]; Ellipse circle = new Ellipse(); circle.Width = 5; circle.Height = 5; circle.Fill = Brushes.Red; InkCanvas.SetTop(circle, firstPoint.Y); InkCanvas.SetLeft(circle, firstPoint.X); inkCanvas1.Children.Add(circle); }
// Prepare to collect stylus packets. Get the // IncrementalHitTester from the InkPresenter's // StrokeCollection and subscribe to its StrokeHitChanged event. protected override void OnStylusDown(StylusDownEventArgs e) { base.OnStylusDown(e); switch (state) { case sMode.add: StylusPointCollection eventPoints = e.GetStylusPoints(this); stylusPoints = new StylusPointCollection(eventPoints.Description); break; case sMode.surround: // Use StrokeChanged event handler to detect stroke encirclement when using percentage myIncrementalHitTester = myInkPresenter.Strokes.GetIncrementalLassoHitTester(50); ((IncrementalLassoHitTester)myIncrementalHitTester).SelectionChanged += new LassoSelectionChangedEventHandler(myIHT_StrokeHitChanged); myIncrementalHitTester.AddPoints(e.GetStylusPoints(this)); break; default: // Otherwise we detect when the IHT hits the existing strokes // Use StrokeIntersectionChanged event handler to detect stroke hit when using stylus EllipseStylusShape eraserTip = new EllipseStylusShape(3, 3, 0); myIncrementalHitTester = myInkPresenter.Strokes.GetIncrementalStrokeHitTester(eraserTip); ((IncrementalStrokeHitTester)myIncrementalHitTester).StrokeHit += new StrokeHitEventHandler(myIHT_StrokeIntersectionChanged); myIncrementalHitTester.AddPoints(e.GetStylusPoints(this)); break; } e.Handled = true; }
// Prepare to collect stylus packets. If Mode is set to Select, // get the IncrementalHitTester from the InkPresenter'newStroke // StrokeCollection and subscribe to its StrokeHitChanged event. protected override void OnStylusDown(StylusDownEventArgs e) { base.OnStylusDown(e); Stylus.Capture(this); // Create a new StylusPointCollection using the StylusPointDescription // from the stylus points in the StylusDownEventArgs. stylusPoints = new StylusPointCollection(); StylusPointCollection eventPoints = e.GetStylusPoints(this, stylusPoints.Description); stylusPoints.Add(eventPoints); InitializeHitTester(eventPoints); }
void inkCanvas1_StylusDown(object sender, StylusDownEventArgs e) { StylusPointDescription desc = e.GetStylusPoints(inkCanvas1, inkCanvas1.DefaultStylusPointDescription).Description; }
private void OnStylusDown(object sender, StylusDownEventArgs e) { this.downPoints = e.GetStylusPoints(AssociatedObject); }