带孔的椭圆
如何创建一个有孔的椭圆(路径,...):
任务是创建三状态指示器的可视化。通过将控件向左或向右旋转几度来可视化不同的状态。
How can I create a ellipse (path, ...) with a hole in it:
The task is to create a visualization of a three-state-indicator. The different states are visualized by rotating the control several degrees to the left or the right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
=>
这里有一些相关的属性,要了解其背后的数学原理,请参阅
http://www.charlespetzold.com/blog/2008/ 01/Mathematics-of-ArcSegment.html
但基本上你给出了两个椭圆相交的坐标:
StartPoint 和 Point 代表相交点,而 Size是完整椭圆的大小。其余的就很不言自明了。
如果你想旋转它,最简单、最好的方法是使用 RotateTransform。
=>
There are a few relevant properties here, to understand the math behind it see
http://www.charlespetzold.com/blog/2008/01/Mathematics-of-ArcSegment.html
But basically you're giving the coordinates of the intersection of two ellipses :
StartPoint and Point represents the intersecting points, While Size is the size of the full ellipse. The rest is pretty self explanatory.
If you want to rotate it, the easiest and best way would be to use RotateTransform.
将“孔”制作为整圆上的白色三角形会有帮助吗?它可以与“指针”(线)一起围绕圆心旋转。
Would making the 'hole' a white triangle on to of the full circle help? This could be rotated around the center of the circle in conjunction with the 'pointer' (the line).
您可以将 CombinedGeometry 与 <代码>GeometryCombineMode="排除"
文档有一个很好的例子。
You can use the CombinedGeometry with the
GeometryCombineMode="Exclude"
The documentation has a good example.