wpf中在Canvas中定义的线条不显示
for (j = 0; j < count - 1; j++)
{
Point startPoint=new Point(data[j, 0],data[j, 1]);
Point endPoint=new Point(data[j + 1, 0],data[j + 1, 1]);
LineGeometry LG = new LineGeometry();
LG.StartPoint = startPoint;
LG.EndPoint =endPoint;
myGeometryGroup.Children.Add(LG);
}
Path mypath = new Path();
mypath.Stroke = Brushes.Red;
DoubleCollection dashs = new DoubleCollection();
//dashs.Add(2);//画虚线
//dashs.Add(2);//画虚线
mypath.StrokeDashArray = dashs;
mypath.StrokeThickness = 1.5;
mypath.Data = myGeometryGroup;
Canvas1.Children.Add(mypath);
其中data是一个double型的二维数组,请问为什么只显示了窗体,不显示线条呢?希望各位大神帮解决一下 谢了!!!
------解决方案--------------------
mypath.Height=
mypath.Width=