渲染 2d 维度的 WPF 控件?
我需要渲染 2d 几何对象的宽度或高度值,并且要求它不仅仅是文本,而且有点像一组建筑平面图的尺寸。像这张图片...哎呀太新了,无法发布图片...就像我在谷歌上搜索到的这张图片 -
http://www.archidigm.com/lounge/archdim/centerline_dim_1.gif
我一直在寻找类似的东西,但还没有我的搜索很幸运。我很乐意创建它,但我认为如果可能的话,我会尽量不重新发明轮子。有人知道有一个控件或库可以呈现这样的东西吗?
I need to render the value of the width or height of a 2d geometry object and the request is for it to not just be text, but somewhat like a dimension that would be a set of building plans. Something like this image...oops too new to post images...like this image that I googled -
http://www.archidigm.com/lounge/archdim/centerline_dim_1.gif
I have looked for something like this, but haven't been lucky in my search. I am fine with creating it, but thought that I would try to not reinvent the wheel if possible. Anyone know of a control or library out there that renders something like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这篇文章看起来确实很有帮助:http://msdn.microsoft.com/en-us /library/bb613591.aspx。尽管它讨论了优化绘图,但它提到了您可以使用的许多不同的类。
具体来说,看看 Drawing 类: http ://msdn.microsoft.com/en-us/library/system.windows.media.drawing.aspx#snippetGroup1
如果您希望形状具有交互性(因为看起来您正在构建类似 CAD 的应用程序),
DrawingGroup
可能会有所帮助。查看此示例:http://msdn。 microsoft.com/en-us/library/system.windows.media.drawinggroup.aspx#snippetGroup此外,
DrawingGroup
可能是对实际形状进行分组的好方法(例如,建筑物中的墙壁)和显示尺寸的标尺对象。This article looks really helpful: http://msdn.microsoft.com/en-us/library/bb613591.aspx. Although it talks about optimizing drawing, it gives mention to a lot of different classes you can use.
Specifically, take a look at the Drawing class: http://msdn.microsoft.com/en-us/library/system.windows.media.drawing.aspx#snippetGroup1
If you want the shapes to be interactive (because it seems like you are building a CAD-like application), the
DrawingGroup
might help. Check out this example: http://msdn.microsoft.com/en-us/library/system.windows.media.drawinggroup.aspx#snippetGroupAlso,
DrawingGroup
might be a good way to group the actual shape (for example, a wall in a building) and the ruler object that shows the dimensions.