1/2 D绘图对象 [英] 1/2 D drawing objects

查看:75
本文介绍了1/2 D绘图对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提前致谢



我想制作一个应用程序,根据用户输入的尺寸(宽度,高度)绘制形状,然后用户可以将它放在根据他的

愿望(他可以用1/2 D交互鼠标拖动/移动左,右或上/下)。





需要建议我应该在WPF或Winforms中执行此操作(是否可以在Winforms中执行此操作)。刚刚开始研究GDI等,所以需要帮助才能朝着正确的方向发展。



任何建议/建议都将受到高度赞赏

Thanks in advance

I want to make an application which will draw shapes according to user entered dimension (width , Height), then user can place it on the form according to his
wish(he can drag/move left , right or top/bottom) with the mouse with 1/2 D interaction.


Need advice that i should do this in WPF or Winforms(Is it possible to do it in Winforms). Just going to start working on GDI etc so need help in going to right direction.

Any recommendations / suggestions will be highly appreciated

推荐答案

是的,它可能在winforms中:

我首先创建一个名为Shape的UserControl,它通过它的Paint事件绘制自己 - 然后你可以从外面设置它的位置,大小和宽度等等,然后处理它通过调用Invalidate方法调整事件大小以重新绘制。



然后,您只需创建所需的Shape实例,并将其添加到表单(或面板,或者其他)以正常方式控制收集。
Yes it''s possible in winforms:
I would start by creating a UserControl called Shape which draws itself via it''s Paint event - you can then set it''s location, size and width and so forth from outside, and handle its Resize event to cause a redraw by calling the Invalidate method.

You then just create each instance of the Shape you need, and add it to the form (or panel, or whatever) Controls Collection in the normal way.


这篇关于1/2 D绘图对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆