开发者

WPF Control that renders a 2d dimension?

开发者 https://www.devze.com 2023-01-27 18:00 出处:网络
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

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. 开发者_如何学GoI 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?


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#snippetGroup

Also, 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消