创建一个保存/绘制一些图形的类?
好的,我想创建一个类来处理特殊的矩形图形。
在我的表单中,我想要两个特殊的矩形。 所以,基本上,我的表单中需要该类的两个实例,对吗?
我设法初始化了两个,好吧。但是,我到底应该如何管理班级中的绘图/图形等,以及如何在我的表单中显示结果?
Ok, I want to create a class that will handle a special rectangle graphic.
In my form, I want to have two of these special rectangles.
So, basically, I need two instances of that class in my form, right?
I manage to initialize two, alright. But, how exactly am I supposed to manage drawing/graphics etc in a class, and the results to be displayed in my form?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要弄清楚一些概念才能将其组合在一起:
这是一个简短的片段:
这是关于 .NET 的 相当不错的教程用VB画画。如果您按照本教程进行操作,您应该拥有完成您喜欢的任何类型的 2D .NET 绘图的所有部分。 (乐趣要到第 2 页才开始,但不要跳过第 1 页!)
There are a few concepts you need to figure out to put this together:
Here's a quick snippet:
And here is a pretty nice tutorial on .NET painting with VB. If you follow it through you should have all the pieces to do any kind of 2D .NET drawing you like. (The fun doesn't start until page 2 but do not skip page 1!)
听起来您需要阅读的两件事是开发自定义控件和在 Windows 窗体中使用 GDI+。
拿一张舒适的椅子和一杯美味的热可可;你有很多阅读要做。
Sounds like the two thing you need to read up on are Developing Custom Controls and Using GDI+ in Windows Forms.
Grab a comfy chair and a nice cup of hot cocoa; you have a lot of reading to do.