Ejemplo n.º 1
0
 protected override void OnStylusMove(RawStylusInput rawStylusInput)
 {
     var movePoint = rawStylusInput.GetStylusPoints()[0];
     var now = DateTime.Now;
     var stamp = (now - currentStroke.DownStylusPointStamp).Ticks;
     currentStroke.StampedStylusPoints.Add(new StampedStylusPoint { Stamp = stamp, StylusPoint = movePoint });
     base.OnStylusMove(rawStylusInput);
 }
Ejemplo n.º 2
0
        ///////////////////////////////////////////////////////////////////// 
        /// <summary>
        /// [TBS] 
        /// </summary>
        protected override void OnStylusMove(RawStylusInput rawStylusInput)
        {
            // Only allow inking if someone has queried our RootVisual. 
            if (_mainContainerVisual != null)
            { 
                StrokeInfo si = FindStrokeInfo(rawStylusInput.Timestamp); 

                if (si != null && (si.StylusId == rawStylusInput.StylusDeviceId)) 
                {
                    // We only render packets that are in the proper order due to
                    // how our incremental rendering uses the last point to continue
                    // the path geometry from. 
                    // NOTE: We also update the LastTime value here too
                    if (si.IsTimestampAfter(rawStylusInput.Timestamp)) 
                    { 
                        si.LastTime = rawStylusInput.Timestamp;
                        RenderPackets(rawStylusInput.GetStylusPoints(), si); 
                    }
                }
            }
        } 
Ejemplo n.º 3
0
        /////////////////////////////////////////////////////////////////////
        /// <summary> 
        /// [TBS]
        /// </summary> 
        protected override void OnStylusDown(RawStylusInput rawStylusInput) 
        {
            // Only allow inking if someone has queried our RootVisual. 
            if (_mainContainerVisual != null)
            {
                StrokeInfo si;
 
                lock(__siLock)
                { 
                    si = FindStrokeInfo(rawStylusInput.Timestamp); 

                    // If we find we are already in the middle of stroke then bail out. 
                    // Can only ink with one stylus at a time.
                    if (si != null)
                    {
                        return; 
                    }
 
                    si = new StrokeInfo(DrawingAttributes, rawStylusInput.StylusDeviceId, rawStylusInput.Timestamp, GetCurrentHostVisual()); 
                    _strokeInfoList.Add(si);
                } 

                rawStylusInput.NotifyWhenProcessed(si);
                RenderPackets(rawStylusInput.GetStylusPoints(), si);
            } 
        }