在 winforms 中创建可移动且可调整大小的线条
我想创建一个程序,其中用户有一个区域,他可以在其中获取我为他提供的线(例如三线)并调整它们的大小和位置以创建一个小图表。
我怎样才能用 winform 做到这一点?
我应该使用哪些类和属性?
多谢
I want to create a program in which the user has an area where he can take lines which I provide him with (for example three lines) and adjust their sizes and locations to create a small diagram.
How can I do that with winforms?
What classes and properties should I use?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您需要 .net 解决方案,请查看 OpenS-CAD ,用于启动的示例“2D CAD”项目。问题是,它是用 C# 编写的,但它会给您 CAD 程序的概念。
您可以使用 C++/Cli 重写它,也可以使用本机 C++ 重写它的某些部分。
Assuming you want a .net solution, have a look at OpenS-CAD,a sample "2D CAD" project for starting. The thing is, it is written in C#, but it will give you the notion of a CAD program.
You can rewrite it with C++/Cli, and also some parts of it with native C++.
我从你的问题中了解到,你希望让用户能够调整大小和位置(类似于 Powerpoint 和其他几个产品中的锚点)并让他/她从中绘制图形。
在这种情况下,您需要使用图形函数,尽管您的一些工作(例如调整大小)可能也需要使用 ovveriding DragDrop 方法。
这是一个示例 http://www.yevol.com/en/vcsharp/applicationdesign /Lesson14.htm ,这可能对您有帮助。
I understand from your question, that you want to give users ability to adjust the size and locations ( similar to anchors in Powerpoint and several other products ) and let him/her draw a figure out of that.
You need to use the graphics functions in that case, though some of your work like resizing might need usage of ovveriding DragDrop method too.
Here is an sample http://www.yevol.com/en/vcsharp/applicationdesign/Lesson14.htm , that might be of help to you.