示例#1
0
        Point CalculateCanvasPositionFromPointValue(GraphPoint graphPoint)
        {
            double factor = FilterFunctionGraph.ActualWidth / 255;
            double x      = graphPoint.Value.X * factor - DRAGGING_POINT_SIZE / 2;
            double y      = FilterFunctionGraph.ActualWidth - (graphPoint.Value.Y * factor + DRAGGING_POINT_SIZE / 2);

            return(new Point(x, y));
        }
示例#2
0
        public int AddPoint(GraphPoint point)
        {
            for (int i = 0; i < points.Count; i++)
            {
                if (point.Value.X < points[i].Value.X)
                {
                    points.Insert(i, point);
                    return(i);
                }
            }

            throw new Exception("Trying to add point with wrong coordinates to the function graph");
        }