开发者

How to do simple 2D Graphics UI basic shapes with mouse interactions

I am trying to make 2D a drawing program similar to MS Viseo, Google Docs Dra开发者_运维百科wings, MS Word. I want to be able draw circles, rectangles, arrows, etc...

I have no idea where to begin at all. Whats the easiest way (platform/framework/language) to not only draw these shapes, but also be able to click and drag with the mouse and reposition them on the screen.

Thanks in advance


The easiest? For me it would be to use the canvas widget of tbe tk toolkit. You can use this toolkit with tcl, python, riby, perl and others, and it works quite well on all platforms. I recommend using it with tcl. For more information see http://www.tkdocs.com

The tk canvas is remarkably powerful and easy to use. It's not as powerful as GL, but you specifically asked for simple.

The canvas is vector based (versus bitmap-based) which means each thing you fraw is an object that can be manipulated. It supports lines, curves, polygons, circles, text and others. Objects can be on top of or behind other objects, and objects can easily be grabbed and moved around. It can even convert your drawing to postscript.

A really basic drawing program in tcl, along with some commentary, can be found here: http://wiki.tcl.tk/13257

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜