Exemplo n.º 1
0
        public static WindowsInk.Stroke ToWindowsStroke(NineInk.Stroke nineStroke)
        {
            var points = new StylusPointCollection();

            foreach (var point in nineStroke.Points)
            {
                points.Add(new StylusPoint(point.X, point.Y, point.Pressure));
            }

            var drwAttr = new WindowsInk.DrawingAttributes();
            var c       = new Color();

            c.R           = nineStroke.DrawingAttributes.Color.R;
            c.G           = nineStroke.DrawingAttributes.Color.G;
            c.B           = nineStroke.DrawingAttributes.Color.B;
            c.A           = nineStroke.DrawingAttributes.Color.A;
            drwAttr.Color = c;

            switch (nineStroke.DrawingAttributes.Brush.Name)
            {
            case "Rectangle":
                drwAttr.StylusTip = WindowsInk.StylusTip.Rectangle;
                break;

            case "Ellipse":
            default:
                drwAttr.StylusTip = WindowsInk.StylusTip.Ellipse;
                break;
            }
            drwAttr.Height        = nineStroke.DrawingAttributes.Height;
            drwAttr.Width         = nineStroke.DrawingAttributes.Width;
            drwAttr.IsHighlighter = nineStroke.DrawingAttributes.IsHighlighter;

            return(new WindowsInk.Stroke(points, drwAttr));
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="SharedPointer" /> class.
 /// </summary>
 /// <param name="isSlide">if set to <c>true</c> [is slide].</param>
 /// <param name="offset">The offset.</param>
 /// <param name="stroke">The stroke.</param>
 public SharedPointer(int offset, Stroke stroke)
 {
     Offset = offset;
     Stroke = stroke;
 }