.Net Graphicspath 的包络失真
我正在尝试找出将 .net 中的 GraphicsPath 扭曲为特定形状的最佳方法。我想要实现的结果是将文本扭曲为向上、向下、向左、向右扇形以及类似波浪的形状。所有这些都可以在 Adobe Illustrator 中使用包络扭曲功能来实现。
我已经考虑过使用一些预定义的网格和点映射系统来实现我自己的方法来转换点。然而,似乎已经有一些关于如何做到这一点的算法或示例?
I'm trying to figure out the best way to accomplish warping a GraphicsPath in .net to a specific shape. The result I'm trying to achieve is warping text to curve up, down, fan left, right, and things like a wave. All of these can be achieved in Adobe Illustrator using the envelope distort feature.
I have considered rolling my own method of doing this using some of predefined grid and point mapping system to transform points. However, it seems like there would be some algorithms or samples as to how to do this already available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想跟进我不久前发表的这篇文章。我已经想出了一些其他方法来完成我在这篇文章中最初想做的事情。首先,GraphicsPath 有一个很好的 warp() 方法,它可以将任何路径扭曲成矩形的 4 个点。使用这个想法你可以完成下面的任务。
这是应用于文本向上拱起的路径的相同扭曲
这是经典的星球大战文本扭曲,只需在 warp() 方法中设置矩形的 4 个点即可

相同的扭曲应用于拱形路径。
我得出的结论是,可以通过首先在这样的路径上键入来完成很多扭曲作为拱门或波浪,然后在 GraphicsPath 中应用 warp() 方法。
更新
近两年后,我终于开始真正想出一个真正的解决方案。我在我的博客上发布了带有代码的深入解释。 在此处阅读
I wanted to follow up to this post I made some time ago. I have had worked out a few other ways to accomplish what I wanted to do originally in this post. First off GraphicsPath has a nice warp() method which performs just that, warping any path into the 4 points of a rectangle. Using this idea you can accomplish this below.
Here is the same warp applied to a path with text arched up
This is the classic star wars text warp by just setting the 4 points of the rectangle in the warp() method

The same warp applied to a path that is arched up.
What I have concluded is a lot of warps can be accomplished by first typing on a path such as an arch or a wave, then applying the warp() method in a GraphicsPath.
Updated
I finally got around to actually coming up with a real solution to this almost 2 years later. I posted an in depth explanation with code on my blog. Read it here
以下是我们使用的验证码生成器中的一些方法,它们可能会引导您走向正确的方向:
Here's a couple of methods from a captcha generator we use that might steer you in the right direction: