private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     ClearSelection();
     inkCanvas.InkPresenter.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed;
     inkCanvas.InkPresenter.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved;
     inkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
 }
Пример #2
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     ClearSelection();
     MainInkCanvas.InkPresenter.UnprocessedInput.PointerPressed  -= UnprocessedInput_PointerPressed;
     MainInkCanvas.InkPresenter.UnprocessedInput.PointerMoved    -= UnprocessedInput_PointerMoved;
     MainInkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
 }
Пример #3
0
        private void StrokeInput_StrokeContinued(InkStrokeInput sender, PointerEventArgs args)
        {
            // Coge el punto por el que ha pasado el cursor pulsado
            Point point = new Point(args.CurrentPoint.Position.X, args.CurrentPoint.Position.Y);

            // Lo añade a la lista de puntos
            points.Add(point);

            // Si la lista tiene más de un punto
            if (points.Count > 1)
            {
                // Creau una lista de InkPoints a partir de la lista de puntos, necesaria para hacer el stroke
                List <InkPoint> inkpoints = new List <InkPoint>();

                foreach (Point p in points)
                {
                    inkpoints.Add(new InkPoint(p, 0.5f));
                }

                // Crea el stroke a partir de los inkpoints
                InkStroke stroke = strokeBuilder.CreateStrokeFromInkPoints(inkpoints, System.Numerics.Matrix3x2.Identity);

                // Copia los atributos de dibujado (color y eso) del canvas original
                InkDrawingAttributes ida = canvas.InkPresenter.CopyDefaultDrawingAttributes();
                stroke.DrawingAttributes = ida;

                // Guarda el ultimo punto
                Point ultimo = points.Last <Point>();

                // Vacía la lista de puntos y le añade el ultimo del anterior stroke, para que el dibujado no de "saltos"
                points = new List <Point>();
                points.Add(ultimo);
            }
        }
Пример #4
0
 private void StrokeInput_StrokeStarted1(InkStrokeInput sender, PointerEventArgs args)
 {
     if (timerStopped == true)
     {
     }
     else
     {
         timer.Interval = new System.TimeSpan(0, 0, 2);
         initPos        = args.CurrentPoint.Position;
         timer.Tick    += Timer_Tick;
         timer.Start();
         while (timerStopped == true)
         {
             ;
         }
         var finPos  = args.CurrentPoint.Position;
         var finMag  = Math.Pow(((finPos.X * finPos.X) + (finPos.Y * finPos.Y)), 0.5);
         var initMag = Math.Pow(((initPos.X * initPos.X) + (initPos.Y * initPos.Y)), 0.5);
         if (finMag - initMag < 15)
         {
             canvasX.InkPresenter.IsInputEnabled = false;
             canvasX.PointerPressed  += CanvasX_PointerPressed;
             canvasX.PointerMoved    -= CanvasX_PointerMoved1;
             canvasX.PointerMoved    += CanvasX_PointerMoved;
             canvasX.PointerReleased += CanvasX_PointerReleased;
         }
     }
 }
        private void InkPresenter_StrokeInputStarted(InkStrokeInput sender, PointerEventArgs args)
        {
            clearedStrokes.Clear();
            inkCleared = false;

            activeTool = inkToolbar.ActiveTool;
        }
        private void InkPresenter_StrokeInputStarted(InkStrokeInput sender, PointerEventArgs args)
        {
            ViewCanvasButton_Click(null, null);

            clearedStrokes.Clear();
            inkCleared = false;

            activeTool = inkToolbar.ActiveTool;
        }
Пример #7
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     IReadOnlyList<InkStroke> currentStrokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
     foreach (InkStroke inkStroke in currentStrokes)
     {
         _core.InkPath(inkStroke.GetInkPoints());
     }
     inkCanvas.InkPresenter.StrokeContainer.Clear();
 }
Пример #8
0
        private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
        {
            IReadOnlyList <InkStroke> currentStrokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();

            foreach (InkStroke inkStroke in currentStrokes)
            {
                _core.InkPath(inkStroke.GetInkPoints());
            }
            inkCanvas.InkPresenter.StrokeContainer.Clear();
        }
Пример #9
0
        private void InkPresenter_StrokeContinued(InkStrokeInput sender, PointerEventArgs args)
        {
            float pressure = ((STROKE_SIZE_MAX - STROKE_SIZE_MIN) * args.CurrentPoint.Properties.Pressure) + STROKE_SIZE_MIN;
            float opacity  = ((STROKE_OPACITY_MAX - STROKE_OPACITY_MIN) * args.CurrentPoint.Properties.Pressure) + STROKE_OPACITY_MIN;

            // apply inking settings
            if (null != _inkCanvas)
            {
                _inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(CreateInkDrawingAttributes(pressure, opacity));
            }
        }
Пример #10
0
        private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
        {
            //builder.BeginStroke(args.CurrentPoint);

            //line = new Line();
            //line.X1 = args.CurrentPoint.RawPosition.X;
            //line.Y1 = args.CurrentPoint.RawPosition.Y;
            //line.X2 = args.CurrentPoint.RawPosition.X;
            //line.Y2 = args.CurrentPoint.RawPosition.Y;

            //line.Stroke = new SolidColorBrush(Colors.Purple);
            //line.StrokeThickness = 4;
        }
Пример #11
0
        private void InkPresenter_StrokeInputStarted(InkStrokeInput sender, PointerEventArgs args)
        {
            inkRecoTimer.Stop();
            textToggleTimer.Stop();

            int    index  = currentCanvas.Name.IndexOf("Canvas");
            string prefix = currentCanvas.Name.Substring(0, index);

            clearedStrokesLists[prefix].Clear();
            inkCleared = false;

            activeTool = inkToolbar.ActiveTool;
        }
        /// <summary>
        /// Cuando el usuario realice una traza pintada, se convertira dicha traza en puntos y se mandarán al servidor para que el restro de jugadores la reciban y la procesen.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void StrokeInput_StrokeContinued(InkStrokeInput sender, PointerEventArgs args)
        {
            // Coge el punto por el que ha pasado el cursor pulsado
            Point point = new Point(args.CurrentPoint.Position.X, args.CurrentPoint.Position.Y);

            // Lo añade a la lista de puntos
            points.Add(point);

            // Si la lista tiene más de un punto
            if (points.Count > 1)
            {
                // Creau una lista de InkPoints a partir de la lista de puntos, necesaria para hacer el stroke
                List <InkPoint> inkpoints = new List <InkPoint>();

                foreach (Point p in points)
                {
                    inkpoints.Add(new InkPoint(p, 0.5f));
                }

                // Crea el stroke a partir de los inkpoints
                InkStroke stroke = builder.CreateStrokeFromInkPoints(inkpoints, System.Numerics.Matrix3x2.Identity);

                // Copia los atributos de dibujado (color y eso) del canvas original
                InkDrawingAttributes ida = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();

                stroke.DrawingAttributes = ida;

                // Le añadae el stroke creado al canvas de copia
                //canvas2.InkPresenter.StrokeContainer.AddStroke(stroke);

                List <clsPunto> punticos = new List <clsPunto>();

                foreach (Point p in points)
                {
                    punticos.Add(new clsPunto(p.X, p.Y, ida.Color, ida.Size));
                }

                if (conn.State == ConnectionState.Connected)
                {
                    proxy.Invoke("strokeDraw", punticos, viewModel.Partida.NombreSala);
                }

                // Guarda el ultimo punto
                Point ultimo = points.Last <Point>();

                // Vacía la lista de puntos y le añade el ultimo del anterior stroke, para que el dibujado no de "saltos"
                points = new List <Point>();
                points.Add(ultimo);
            }
        }
Пример #13
0
        private void InkPresenter_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
        {
            // hide the pen icon
            if (!_touchHereWasHidden)
            {
                if (null != _penTouchPointGrid)
                {
                    AnimationHelper.PerformFadeOut(_penTouchPointGrid, 100d, 0d);
                }

                _touchHereWasHidden = true;
            }

            // telemetry
            //TelemetryService.Current?.SendTelemetry(TelemetryService.TELEMETRY_STARTPEN, System.DateTime.UtcNow.ToString("yyyy-MM-dd hh:mm:ss tt", CultureInfo.InvariantCulture), true, 0);
        }
Пример #14
0
        private void InkPresenter_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
        {
            RaisePenScreenContactStartedEvent(this);
            FadeInColoringImage();

            float pressure = ((STROKE_SIZE_MAX - STROKE_SIZE_MIN) * args.CurrentPoint.Properties.Pressure) + STROKE_SIZE_MIN;
            float opacity  = ((STROKE_OPACITY_MAX - STROKE_OPACITY_MIN) * args.CurrentPoint.Properties.Pressure) + STROKE_OPACITY_MIN;

            // apply inking settings
            if (null != _inkCanvas)
            {
                _inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(CreateInkDrawingAttributes(pressure, opacity));
            }

            // telemetry
            TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.StartPen);
        }
        private async void StrokeInput_StrokeEndedAsync(InkStrokeInput sender, PointerEventArgs args)
        {
            await Task.Delay(100);

            var XBound = InkCanvas.InkPresenter.StrokeContainer.BoundingRect.Bottom;

            if (XBound > InkCanvas.ActualHeight - 500)
            {
                InkCanvas.Height = XBound + 500;
            }

            var YBound = InkCanvas.InkPresenter.StrokeContainer.BoundingRect.Right;

            if (YBound > InkCanvas.ActualWidth - 500)
            {
                InkCanvas.Width = YBound + 500;
            }
        }
Пример #16
0
        private void InkPresenter_StrokeInputStarted(InkStrokeInput sender, PointerEventArgs args)
        {
            dispatcherTimer.Stop();

            int    index  = currentCanvas.Name.IndexOf("Canvas");
            string prefix = currentCanvas.Name.Substring(0, index);

            var formField = this.FindName($"{prefix}") as Grid;

            if (formField.Tag.ToString() == "accepted")
            {
                formField.BorderBrush = new SolidColorBrush(Colors.Yellow);
                formField.Tag         = "pending";
            }

            clearedStrokesLists[prefix].Clear();
            inkCleared = false;

            activeTool = inkToolbar.ActiveTool;
        }
Пример #17
0
        private void InkPresenter_StrokeEnded(InkStrokeInput sender, PointerEventArgs args)
        {
            //// show the pen icon
            //if (null != _touchHereImage)
            //{
            //    AnimationHelper.PerformFadeIn(_touchHereImage, 100d, 0d);
            //}

            // change the ink color
            if (null != _inkCanvas)
            {
                InkDrawingAttributes inkDrawingAttributes = new InkDrawingAttributes()
                {
                    Color = GetNextColor(),
                    //FitToCurve = true,
                    PenTip = PenTipShape.Circle,
                    Size   = new Size(WINDOW_BOUNDS.Width * 0.02, WINDOW_BOUNDS.Height * 0.02)
                };
                _inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(inkDrawingAttributes);
            }

            // telemetry
            //TelemetryService.Current?.SendTelemetry(TelemetryService.TELEMETRY_ENDPEN, System.DateTime.UtcNow.ToString("yyyy-MM-dd hh:mm:ss tt", CultureInfo.InvariantCulture), true, 0);
        }
Пример #18
0
 private void StrokeInput_StrokeEnded(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     UpdateTime(false, true);
 }
Пример #19
0
 private void StrokeInput_StrokeEnded(InkStrokeInput sender, PointerEventArgs args)
 {
     points = new List <Point>();
 }
Пример #20
0
        private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
        {
            ClearSelection();

            canvasControl.Invalidate();
        }
Пример #21
0
 private void StrokeInput_StrokeCanceled(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     inkCanvas.InkPresenter.StrokeContainer.Clear();
 }
Пример #22
0
 private void StrokeInput_StrokeEnded(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
 }
Пример #23
0
 private void StrokeInput_StrokeCanceled(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     inkCanvas.InkPresenter.StrokeContainer.Clear();
 }
Пример #24
0
 private void StrokeInput_StrokeEnded(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
   
 }
Пример #25
0
 // Handler for the InkPresenter StrokeStarted event.
 // If a new stroke starts before the next timer tick event,
 // stop the timer as the new stroke is likely the continuation
 // of a single handwriting entry.
 private void inkCanvas_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     recoTimer.Stop();
 }
Пример #26
0
 private void OnStrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     StrokeStarted?.Invoke(sender, EventArgs.Empty);
 }
Пример #27
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     UpdateTime(true, false);
 }
 public InkStrokeInputEvents(InkStrokeInput This)
 {
     this.This = This;
 }
Пример #29
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     this.toolBox.Margin = new Thickness(0, -this.toolBox.ActualHeight, 0, 0);
 }
Пример #30
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     // Don't perform analysis while a stroke is in progress.
     dispatcherTimer.Stop();
 }
Пример #31
0
 /// <summary>
 /// Stops the timer if a new stroke has started
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void InkCanvas_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     recognitionTimer.Stop();
 }
Пример #32
0
 void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     Clear();
 }
Пример #33
0
        private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
        {
            ClearSelection();

            canvasControl.Invalidate();
        }
Пример #34
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     _recoTimer.Start();
 }
Пример #35
0
 private void StrokeInput_StrokeEnded(InkStrokeInput sender, PointerEventArgs args)
 {
     this.toolBox.Margin = new Thickness(0, 0, 0, 0);
 }
Пример #36
0
 private void StrokeInput_StrokeEnded(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
 {
     // _recoTimer.Stop();
 }
Пример #37
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
 }
Пример #38
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     EndLassoSelectionConfig();
 }
Пример #39
0
 private void StrokeInput_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
 {
     strokeTimer.Stop();
 }