Esempio n. 1
0
        private void DrawVerticalCoordinatesLines(DrawingContext drawingContext, DrawSetting drawSetting)
        {
            int    coordinateStep      = drawSetting.GetCoordinateStep();
            double scaleCoordinateStep = drawSetting.GetScaleCoordinateStep();

            double stepCounterHorizontalAxis23 = 0;

            for (double i = drawSetting.BasePoint.X; i > 0; i -= scaleCoordinateStep)
            {
                drawingContext.DrawLine(drawSetting.GraphBoltPen, new Point(i, 0), new Point(i, drawSetting.DrawSize.Width));
                Point p1 = new Point(i, drawSetting.BasePoint.Y);
                Point p2 = new Point(i, drawSetting.BasePoint.Y + 10);
                drawingContext.DrawLine(drawSetting.CoordinatesGraphPen, p1, p2);
                drawingContext.DrawText(drawSetting.GetFormattedCoordinatesText(stepCounterHorizontalAxis23.ToString()), p2);
                stepCounterHorizontalAxis23 -= coordinateStep;
            }

            int stepCounterHorizontalAxis14 = 0;

            for (double i = drawSetting.BasePoint.X; i < drawSetting.DrawSize.Width; i += scaleCoordinateStep)
            {
                drawingContext.DrawLine(drawSetting.GraphBoltPen, new Point(i, 0), new Point(i, drawSetting.DrawSize.Width));
                Point p1 = new Point(i, drawSetting.BasePoint.Y);
                Point p2 = new Point(i, drawSetting.BasePoint.Y + 10);
                drawingContext.DrawLine(drawSetting.CoordinatesGraphPen, p1, p2);
                drawingContext.DrawText(drawSetting.GetFormattedCoordinatesText(stepCounterHorizontalAxis14.ToString()), p2);
                stepCounterHorizontalAxis14 += coordinateStep;
            }
        }
Esempio n. 2
0
        private void DrawHorizontalCoordinatesLines(DrawingContext drawingContext, DrawSetting drawSetting)
        {
            int    coordinateStep      = drawSetting.GetCoordinateStep();
            double scaleCoordinateStep = drawSetting.GetScaleCoordinateStep();

            double stepCounterVerticalAxis12 = 0;

            for (double i = drawSetting.BasePoint.Y; i > 0; i -= scaleCoordinateStep)
            {
                drawingContext.DrawLine(drawSetting.GraphBoltPen, new Point(0, i), new Point(drawSetting.DrawSize.Width, i));
                Point p1 = new Point(drawSetting.BasePoint.X, i);
                Point p2 = new Point(drawSetting.BasePoint.X + 10, i);
                drawingContext.DrawLine(drawSetting.CoordinatesGraphPen, p1, p2);
                drawingContext.DrawText(drawSetting.GetFormattedCoordinatesText(stepCounterVerticalAxis12.ToString()), p2);
                stepCounterVerticalAxis12 += coordinateStep;
            }

            int stepCounterVerticalAxis34 = 0;

            for (double i = drawSetting.BasePoint.Y; i < drawSetting.DrawSize.Height; i += scaleCoordinateStep)
            {
                drawingContext.DrawLine(drawSetting.GraphBoltPen, new Point(0, i), new Point(drawSetting.DrawSize.Width, i));
                Point p1 = new Point(drawSetting.BasePoint.X, i);
                Point p2 = new Point(drawSetting.BasePoint.X + 10, i);
                drawingContext.DrawLine(drawSetting.CoordinatesGraphPen, p1, p2);
                drawingContext.DrawText(drawSetting.GetFormattedCoordinatesText(stepCounterVerticalAxis34.ToString()), p2);
                stepCounterVerticalAxis34 -= coordinateStep;
            }
        }