首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

blend如何画曲线图

2013-08-16 
blend怎么画曲线图要画两个曲线图,就像示波器那种,带坐标,用什么控件?我知道在winform里可以用graphpane,b

blend怎么画曲线图
要画两个曲线图,就像示波器那种,带坐标,用什么控件?
我知道在winform里可以用graphpane,blend里面有没有类似的? 控件 画图 WPF
[解决办法]
Path或PolyLine

private void CreateAPolyline()
{
    // Create a blue and a black Brush
    SolidColorBrush yellowBrush = new SolidColorBrush();
    yellowBrush.Color = Colors.Yellow;
    SolidColorBrush blackBrush = new SolidColorBrush();
    blackBrush.Color = Colors.Black;
 
    // Create a polyline
    Polyline yellowPolyline = new Polyline();
    yellowPolyline.Stroke = blackBrush;
    yellowPolyline.StrokeThickness = 4;
 
    // Create a collection of points for a polyline
    System.Windows.Point Point1 = new System.Windows.Point(10, 100);
    System.Windows.Point Point2 = new System.Windows.Point(100, 200);
    System.Windows.Point Point3 = new System.Windows.Point(200, 30);
    System.Windows.Point Point4 = new System.Windows.Point(250, 200);
    System.Windows.Point Point5 = new System.Windows.Point(200, 150);
    PointCollection polygonPoints = new PointCollection();
    polygonPoints.Add(Point1);
    polygonPoints.Add(Point2);
    polygonPoints.Add(Point3);
    polygonPoints.Add(Point4);
    polygonPoints.Add(Point5);
 
    // Set Polyline.Points properties
    yellowPolyline.Points = polygonPoints;
 
    // Add polyline to the page
    LayoutRoot.Children.Add(yellowPolyline);
}

热点排行