“慢慢地”画线在画布上
我有 2 个点,我需要画一条连接这 2 个点的线。我希望绘制的线以慢动作从一个点开始并连接另一个点。
目前,我正在使用画布来画线。
var line = new Line();
line.Stroke = Brushes.Black;
line.StrokeThickness = 2.0;
line.X1 = 1.0;
line.Y1 = 1.0;
line.X2 = 10.0;
line.Y2 = 10.0;
Canvas.SetRight(myCanvas, From.X);
Canvas.SetBottom(myCanvas, From.Y);
myCanvas.Children.Add(line);
任何库函数都可以吗?
I have 2 points and I need to draw a line connecting the 2 points. I want the line drawn to be in slow motion starting from one point and connecting another point.
Currently, I am using a canvas to draw the line.
var line = new Line();
line.Stroke = Brushes.Black;
line.StrokeThickness = 2.0;
line.X1 = 1.0;
line.Y1 = 1.0;
line.X2 = 10.0;
line.Y2 = 10.0;
Canvas.SetRight(myCanvas, From.X);
Canvas.SetBottom(myCanvas, From.Y);
myCanvas.Children.Add(line);
Is it possible with any library function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会将起点和终点设置为相同,然后使用故事板对终点的 x,y 进行动画处理。您可以通过这种方式设置各种变量。
I would set the start and end points to be the same, then animate the x,y of the end points using a storyboard. You can set all sorts of variables on it this way.