创建高级 HUD
我正在 WPF 中为 AR 无人机四轴飞行器制作一个界面。
我的 HUD 上需要一些东西才能使其可用。
HUD 上更先进的控制之一是人工地平线,它告诉飞行员飞行器当前与地平线的对齐情况。
我有这 3 个 PNG
我将移动的第一张图像(飞行器的当前俯仰角)并旋转(当前的工艺卷)。
我将把第二个图像放在第一个图像上,这个图像只会绕中心轴旋转,它有一定程度的刻度,这将使飞行器的滚动更加可视化。
我将把最后一张放在第二张的上面,这张图片只是一个视觉改进。
然后我想屏蔽第一张图像,以便您只能看到图像 2 中圆圈内的内容。
最后但并非最不重要的一点是,我想向其中添加一个文本块并显示当前海拔高度
结果将如下所示
我知道如何旋转和移动图像,但如何将图像放在彼此的顶部,以及如何遮盖第一个图像?
编辑:感谢 Ben,我已经做到了这一点:
但我还需要翻译图像 Y 位置(飞机的俯仰角)
当我添加平移变换时,我也平移剪辑(蒙版),我该如何平移图像不移动掩模?
I'm making an interface for the AR Drone Quadcopter in WPF.
I neen some stuff on my HUD to make it usable.
One of the more advanced controls on the HUD is the artificial horizon, which tells the pilot the craft's current alignment to the horizon.
I have these 3 PNGs
The first image I will move (The current pitch of the craft) and rotate (The current roll of the craft).
I will put the second image over the first, this one will only rotate around the center axis, it has ticks at certain degrees which will visualize the craft's roll even more.
The last one I will put on top of the second, this image just a visual improver.
Then I want to mask first image so that you only see whats inside the circle in image 2.
Last but not least I want to add a textblock to it and display the current altitude
The result will look something like this
I know how to rotate and move the image, but how do I place the images on top of each other, and how do I mask the first image?
edit: Thanks to Ben I've gotten this far:
But I also need to translate the image Y position (The pitch of the aircraft)
When I add the translate transform I also translate the Clip (Mask) how can I translate the image without moving the mask?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一个小示例,说明如何在其中使用
DrawingGroups
和ClipGeometry
。A little sample that how you can use
DrawingGroups
and aClipGeometry
inside it.昨晚我很累:D
要使背景旋转和平移而不是剪切,只需将背景放入剪切组的子组中...现在可以了!
I was tired last night :D
To get the background to rotate and translate but not the Clipping was just to put the background in a sub group to the clipping group... Now it works!