private void drawText(double x, double y, string text, Color color,Canvas canvasObj) { TextBlock textBlock = new TextBlock(); textBlock.Text = text; textBlock.Foreground = new SolidColorBrush(color); Canvas.SetLeft(textBlock, x); Canvas.SetTop(textBlock, y); canvasObj.Children.Add(textBlock); }
drawText(l.X1, l.Y1,"Text", Color.FromRgb(200, 0, 0), myCanvas);
原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/277135.html