Silverlight - 如何画一条带弧线的线?
我正在开发一个小型 silverlight 应用程序(使用 siverlight 4 和 c#)。在我的应用程序中,我需要根据 X、Y 绘制坐标。然后,我需要根据一些点之间的连接在它们之间画线。由于可能有多条线,而且我不能让它们全部相互交叉(因为这会让这变得一团糟),所以我需要用拱形画一些线。
那么,解决这个问题的最佳方法是什么?
- 创建我自己的 x,y 系统 - 将元素定位在点中并绘制线 - 如果是这样,我如何绘制带有拱形的线?
- 使用提供类似功能的现成控件?如果是的话,用什么控制?
谢谢你!
附上一张小图片来说明我的需求(抱歉,我不是大画家)。
I am developing a small silverlight application (using siverlight 4 and c#). In my application I need to draw coordinates based on their X,Y. Then, I need to draw lines between some of the points, based on the connections between them. Since there can be several lines, and I cannot have them all intersecting each other (as it will turn this into a mess), I need to draw some of my lines with an arch.
So, What would be the best way to approach this issue?
- Create my own x,y system - position elements in points and draw lines - If so How can I draw a line with an arch?
- Use a ready control that provides similar capabilities? If so, what control?
Thank You!
Attached is a small image to illustrate my need (I am no big painter, sorry).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下绘制贝塞尔曲线 (MSDN 链接)并了解不同的几何类型(MSDN 链接)
下面是一个可帮助您入门的代码示例,它将生成以下图像:
Take a look at drawing Bezier curves (MSDN Link) and learn about the different geometry types (MSDN Link)
Below is a code sample to get you started that will produce the following image: