Exemplo n.º 1
0
 /// <summary>
 /// Adds an Ink Stroke and updates the Sketch.  NOTE: Does NOT check
 /// to ensure that the given Ink stroke is contained within the
 /// Ink object associated with this InkSketch.
 /// </summary>
 /// <param name="iStroke">The Ink Stroke to add</param>
 public void AddInkStroke(Microsoft.Ink.Stroke iStroke)
 {
     Sketch.Stroke sStroke = mReadJnt.InkStroke2SketchStroke(iStroke);
     ink2sketchStr.Add(iStroke.Id, sStroke.Substrokes[0].XmlAttrs.Id); // Converted stroke will always have
                                                                       // exactly one substroke.
     sketchStr2ink.Add(sStroke.Substrokes[0].XmlAttrs.Id, iStroke.Id);
     substrokeIdMap.Add(sStroke.Substrokes[0].XmlAttrs.Id, sStroke.Substrokes[0]);
     Sketch.AddStroke(sStroke);
     if (StrokeAdded != null)
     {
         StrokeAdded(sStroke);
     }
 }
Exemplo n.º 2
0
        private Sketch.Shape MakeShape()
        {
            List <Sketch.Substroke> strokes = new List <Sketch.Substroke>();

            foreach (Stroke stroke in m_Ink.Ink.Strokes)
            {
                Sketch.Stroke s = m_ReadJnt.InkStroke2SketchStroke(stroke);
                strokes.Add(s.SubstrokesL[0]);
            }

            Sketch.Shape shape = new Sketch.Shape(strokes, new Sketch.XmlStructs.XmlShapeAttrs());

            return(shape);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Removes stroke data from a Microsoft Ink object and converts it into a sketch
        /// friendly format
        /// </summary>
        /// <param name="ink">A Microsoft Ink object</param>
        /// <returns>An ArrayList containing Sketch stroke data</returns>
        private List <Sketch.Stroke> CreateConvertedStrokes(Ink ink)
        {
            List <Sketch.Stroke> strokes = new List <Sketch.Stroke>();

            ReadJnt readJnt = new ReadJnt();

            //Goes through the ink object, converts each stroke to a sketch stroke and adds
            //it to the List of strokes
            foreach (Microsoft.Ink.Stroke istroke in ink.Strokes)
            {
                strokes.Add(readJnt.InkStroke2SketchStroke(istroke, null, false));
            }

            return(strokes);
        }