System.Drawing.Drawing2D.GraphicsPath.GetLastPoint C# (CSharp) Method

GetLastPoint() public method

public GetLastPoint ( ) : PointF
return PointF
        public PointF GetLastPoint()
        {
            if (points.Count <= 0)
                throw new ArgumentException("Parameter is not valid");

            var lastPoint = points [points.Count - 1];
            return lastPoint;
        }

Usage Example

Exemplo n.º 1
0
        public override GraphicsPath Path(SvgRenderer renderer)
        {
            if (_Path == null || this.IsPathDirty)
            {
                _Path = new GraphicsPath();

                try
                {
                    for (int i = 0; i < Points.Count; i += 2)
                    {
                        PointF endPoint = new PointF(Points[i].ToDeviceValue(renderer, UnitRenderingType.Horizontal, this), 
                                                     Points[i + 1].ToDeviceValue(renderer, UnitRenderingType.Vertical, this));

                        // TODO: Remove unrequired first line
                        if (_Path.PointCount == 0)
                        {
                            _Path.AddLine(endPoint, endPoint);
                        }
                        else
                        {
                            _Path.AddLine(_Path.GetLastPoint(), endPoint);
                        }
                    }
                }
                catch (Exception exc)
                {
                    Trace.TraceError("Error rendering points: " + exc.Message);
                }
                this.IsPathDirty = false;
            }
            return _Path;
        }
All Usage Examples Of System.Drawing.Drawing2D.GraphicsPath::GetLastPoint