在字符串表示形式中移动 C# 中的 System.Windows.Shapes.Path

发布于 2024-10-02 06:56:51 字数 203 浏览 0 评论 0原文

我有一些 Path 的字符串表示。我想移动字符串演示中的路径对象。例如,我将 "M 10,100 C 100,0 200,200 300,100" 移动到 (5, 0) 上并得到 "M 15,100 C 105,0 205,200 305,100"< /代码>。有标准方法吗?

I have string presentation of some Path. I want to move path object in string presentation. For example I move "M 10,100 C 100,0 200,200 300,100" on (5, 0) and get "M 15,100 C 105,0 205,200 305,100". There is standart method for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

疯到世界奔溃 2024-10-09 06:56:51

最简单的方法是使用小写版本的命令来定义路径中相对于当前点的所有坐标:

"M 100,0 c 0,0 200,200 300,100"

这样您只需更改初始移动坐标,整个形状就会受到影响。

The easiest way to do this is to define all coordinates in the path relative to the current point, by using the lowercase version of the commands:

"M 100,0 c 0,0 200,200 300,100"

this way you only need to change the initial Move coordinates and the entire shape will be affected.

几味少女 2024-10-09 06:56:51

没有任何内置或“标准”的东西。

您将需要解析字符串(或反序列化它),进行更新并输出结果。

There is nothing built in or "standard".

You will need to parse the string (or deserialize it), make the updates and output the result.

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