windows-phone-8.1inkmanager

Windows phone 8.1 ink manager alternative


I have an universal app and the windows version use ink manager to capture a signature. I want to do the same with the phone but the ink manager dont exist. Does anyone have or know an alternative.


Solution

  • I added a canvas named Display and add this code using two events.

      private Point _currentPoint;
        private Point _oldPoint;
    
    
        private async void Display_PointerMoved(object sender, PointerRoutedEventArgs e)
        {
            DrawPoint(e);
        }
    
        private void DrawPoint(PointerRoutedEventArgs e)
        {
    
            _currentPoint = e.GetCurrentPoint(this).Position;
    
            Line linea = new Line
            {
                 Stroke = new SolidColorBrush(Colors.Black),
                 StrokeThickness=1,
                 X1 = _currentPoint.X,
                 Y1 = _currentPoint.Y,
                 X2 = _oldPoint.X,
                 Y2 = _oldPoint.Y
            };
    
            Display.Children.Add(linea);
    
            _oldPoint = _currentPoint;
    
    
        }
    
        private void Display_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
    
            _currentPoint = e.GetCurrentPoint(this).Position;
            _oldPoint = _currentPoint;
    
    
        }