【问题标题】:How to add many Polylines to canvas element?如何向画布元素添加多条折线?
【发布时间】:2013-09-27 14:09:16
【问题描述】:

我有这样的东西:canvasGraph.Children.Add(new Polyline(){Points = new PointCollection((x1, y1), (x2, y2))}); 但它不起作用,我不知道如何处理它

【问题讨论】:

    标签: c# wpf canvas polyline


    【解决方案1】:

    您正在以错误的方式初始化您的积分收集:

    canvasGraph.Children.Add(new Polyline(){
      Points = new PointCollection(
        new List<Point> {
          new Point(x1, y1), 
          new Point(x2, y2)})});
    

    【讨论】:

      猜你喜欢
      • 2016-01-14
      • 2016-03-04
      • 1970-01-01
      • 1970-01-01
      • 2014-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多