Beispiel #1
0
        /// <summary>
        /// 在画板上绘制折线
        /// </summary>
        public void DrawingLinesOnCanvas()
        {
            canvas.ClearVisual();

            for (int i = 0; i < BrokenLines.Count; ++i)
            {
                //每条线作为一个visual对象
                DrawingVisual visual = new DrawingVisual();
                DrawingLinesOnVisual(visual, BrokenLines[i], i);
                canvas.AddVisual(visual);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 在画板上绘制折线
        /// </summary>
        private void DrawingLinesOnCanvas(DrawingCanvas drawingCanvas)
        {
            drawingCanvas.ClearVisual();

            List <BrokenLine> newLines = new List <BrokenLine>();

            foreach (var line in BrokenLines)
            {
                newLines.Add(line.DeepClone());
            }

            //获取拉伸过的曲线
            GetStretchLines(newLines);
            //遍历曲线
            for (int i = 0; i < newLines.Count; ++i)
            {
                //每条线作为一个visual对象
                DrawingVisual visual = new DrawingVisual();
                DrawingLinesOnVisual(visual, newLines[i], i);
                drawingCanvas.AddVisual(visual);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 清除绘制的内容
 /// </summary>
 public void ClearVisual()
 {
     canvas.ClearVisual();
 }