C# 如何创建 WPF 形状编辑器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/244235/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create a WPF Shape Editor?
提问by Pop Catalin
I'm trying to create a WPF Shape (PolyLine) editor, which is a control that I want to use to, edit shapes in a canvas.
我正在尝试创建一个 WPF 形状(折线)编辑器,这是一个我想用来在画布中编辑形状的控件。
What the editor needs to do is to be able to display the points and lines of the shape and to move those around.
编辑器需要做的是能够显示形状的点和线并移动它们。
Can anyone provide me with a idea of how I can accomplish this, or a starting point? I haven't found anything related to how I could do this, so far.
任何人都可以向我提供有关如何完成此操作或起点的想法吗?到目前为止,我还没有找到任何与我如何做到这一点有关的东西。
采纳答案by Robert Vukovi?
There is good series of texts about this on CodeProject
CodeProject上有很多关于这方面的文章
回答by Andy Dent
I also liked the WPF DrawTools article on CodeProject, which has a very nicely formatted set of source classes. It provides a simpler example of outline shapes - ellipse, rectangle, line, polyline and text. Unfortunately, it was deleted in 2015, as someone just pointed out to me.
我还喜欢 CodeProject 上的 WPF DrawTools 文章,它有一组格式非常好的源类。它提供了一个更简单的轮廓形状示例 - 椭圆、矩形、线条、折线和文本。不幸的是,正如刚刚有人向我指出的那样,它在 2015 年被删除了。
A copy of the article is available through the Wayback Machinebut the linked source code has been deleted along with the original article. The article includes class diagrams and enough detail to give you a good idea of the overall design.
该文章的副本可通过 Wayback Machine 获得,但链接的源代码已与原始文章一起删除。这篇文章包括类图和足够的细节,让您对整体设计有一个很好的了解。
Nowadays I think it's worth looking at Kimono Designer, although it seems to have been announced to a lot of excitement and the codehasn't been updated for a year. Note there is a WPF port, as discussed in this articleand sample on GitHub.
现在我认为和服设计器很值得一看,虽然它似乎已经公布了很多令人兴奋的东西,而且代码已经一年没有更新了。请注意,有一个 WPF 端口,如本文和GitHub 上的示例中所述。