zoukankan      html  css  js  c++  java
  • WPF画辐射图

       public void WriteLineCircle(double originX, double originY, double r, int lineCount,List<string> list)
            {
                for (int i = 0; i < lineCount; i++)
                {
                    list.Add("你好");
                    double xget = Math.Cos(2*Math.PI*i / lineCount)*r;
                    double yget = Math.Sin(2*Math.PI * i / lineCount)*r;
                    can.Children.Add(DrawLine(originX, originY, originX + xget, originY+yget, new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF0000")), 2));//
                    TextBlock text = new TextBlock();
                    text.Margin = new Thickness(originX + xget, originY + yget, 0, 0);
                    text.Text = list[i];
                    can.Children.Add(text);
                }
            }
    
            public Path DrawLine(double startX, double startY, double endXL, double endYL, Brush color, double thickness)
            {
                Path path = new Path
                {
                    Stroke = color,
                    StrokeThickness = thickness
                };
                LineGeometry line = new LineGeometry
                {
                    StartPoint = new Point(startX, startY),
                    EndPoint = new Point(endXL, endYL)
                };
                path.Data = line;
                return path;
            }
     <Canvas Height="800" Width="800" Name="can" Background="Azure"></Canvas>
    

     

    每天进步一点点。
  • 相关阅读:
    列表的排序和统计。
    pyoo6 列表 004
    py005 列表 03
    py004列表02
    py 003 列表01
    py。002 字符串(str)
    py_001 运算符
    【python--字典】 字典的嵌套
    【python--字典】 字典的增删改查
    【python--字典】 字典的有效性
  • 原文地址:https://www.cnblogs.com/snow-zhang/p/10173786.html
Copyright © 2011-2022 走看看