Exemplo n.º 1
0
        /// <inheritdoc />
        public bool TryGetPointAtDistance(double distance, out Point point)
        {
            if (EffectivePath is null)
            {
                point = new Point();
                return(false);
            }

            var res = CachedPathMeasure.GetPosition((float)distance, out var skPoint);

            point = new Point(skPoint.X, skPoint.Y);
            return(res);
        }
Exemplo n.º 2
0
        public bool TryGetSegment(double startDistance, double stopDistance, bool startOnBeginFigure,
                                  out IGeometryImpl segmentGeometry)
        {
            if (EffectivePath is null)
            {
                segmentGeometry = null;
                return(false);
            }

            segmentGeometry = null;

            var _skPathSegment = new SKPath();

            var res = CachedPathMeasure.GetSegment((float)startDistance, (float)stopDistance, _skPathSegment, startOnBeginFigure);

            if (res)
            {
                segmentGeometry = new StreamGeometryImpl(_skPathSegment);
            }

            return(res);
        }