“慢慢地”画线在画布上

发布于 2024-11-28 08:26:40 字数 386 浏览 3 评论 0原文

我有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

标点 2024-12-05 08:26:40

我会将起点和终点设置为相同,然后使用故事板对终点的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文