WPF画辐射图

时间:2023-03-09 18:18:18
WPF画辐射图
   public void WriteLineCircle(double originX, double originY, double r, int lineCount,List<string> list)
{
for (int i = ; i < lineCount; i++)
{
list.Add("你好");
double xget = Math.Cos(*Math.PI*i / lineCount)*r;
double yget = Math.Sin(*Math.PI * i / lineCount)*r;
can.Children.Add(DrawLine(originX, originY, originX + xget, originY+yget, new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF0000")), ));//红
TextBlock text = new TextBlock();
text.Margin = new Thickness(originX + xget, originY + yget, , );
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>

 WPF画辐射图