private void DataCapture_NewInkSample(CalibratedInkSample cal)
        {
            DrawSample(cal);

            if(NewInkSample != null)
                NewInkSample(cal);
        }
Esempio n. 2
0
        private void DataCapture_NewInkSample(CalibratedInkSample cal)
        {
            DrawSample(cal);

            if (NewInkSample != null)
            {
                NewInkSample(cal);
            }
        }
        public override bool Equals(object obj)
        {
            CalibratedInkSample cal = (CalibratedInkSample)obj;

            return(cal.Time == Time &&
                   cal.X == X &&
                   cal.Y == Y &&
                   cal.Pressure == Pressure);
        }
        protected void DrawSample(CalibratedInkSample cal)
        {
            if (!DrawInk)
                return;

            using (Graphics g = CreateGraphics())
            {
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

                DrawSample(g, Size, cal);
            }
        }
        private void DrawSample(Graphics g, Size clientArea, CalibratedInkSample sample)
        {
            CalibratedInkSample lastSample;

            if(_Ink.Count == 0)  //no previous ink samples
                lastSample = new CalibratedInkSample(0,0,0,-1);
            else
                lastSample = _Ink[_Ink.Count - 1];

            RawInkSample raw = InkCalibration.Current.CalibratedToRaw(g, sample, clientArea);  //the current raw sample
            RawInkSample lastRaw = (lastSample.IsInvalid()
                                    ? raw : InkCalibration.Current.CalibratedToRaw(g, lastSample, clientArea));

            _InkPen.Draw(
                g,
                DrawPressureMode,
                lastSample,
                sample,
                lastRaw,
                raw);

            _Ink.Add(sample);
        }