System.Drawing.PointF.Subtract C# (CSharp) Method

Subtract() public static method

public static Subtract ( System pt, System sz ) : System.Drawing.PointF
pt System
sz System
return System.Drawing.PointF
        public static System.Drawing.PointF Subtract(System.Drawing.PointF pt, System.Drawing.Size sz) { throw null; }
        public static System.Drawing.PointF Subtract(System.Drawing.PointF pt, System.Drawing.SizeF sz) { throw null; }

Same methods

PointF::Subtract ( PointF pt, Size sz ) : PointF
PointF::Subtract ( PointF pt, SizeF sz ) : PointF

Usage Example

Ejemplo n.º 1
0
        public void ApplyPoint(PointF point)
        {
            var offset = point.Subtract(_startPoint);

            if (points.Count == 0)
            {
                points.Add(new GesturePoint { X = offset.X, Y = offset.Y, threshold = 10 });
            }
            else
            {
                var last = points.Last();
                var lastPoint = new PointF(last.X, last.Y);

                // first check distance from last point
                if (lastPoint.DistanceTo(offset) > 10)
                {
                    var currentAngle = _previousOffset.AngleTo(offset);
                    var previousAngle = lastPoint.AngleTo(_previousOffset);

                    var da = currentAngle - previousAngle;
                    if (da < -Math.PI) da += 2 * Math.PI;
                    if (da > Math.PI) da -= 2 * Math.PI;

                    if (da > 0.1)
                    {
                        AddPoint(_previousOffset);
                    }
                }
            }

            _previousOffset = offset;
        }
All Usage Examples Of System.Drawing.PointF::Subtract