Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interactive vector graphics canvas for python?

I'm writing a small application in Python, and I wanted the user to be able to place, move, rotate, etc. different objects on a canvas. Is there any way to accomplish that without a ton of coding? I'm doing this in my free time, and I only have a limited experience in PyQt.

That's basically what any vector graphics editor does (ie. Inkscape, Corel Draw or Dr. Geo): they give the users handles to move, stretch and rotate objects. I was wondering if there's any widget or whatever that already provides the handles and the basic operations, so I only have to implement the program's reaction to those operations.

Since I'm planning on releasing this under a free license (if I ever get to the point of releasing) any open source license would be great.

Thanks!

like image 374
Arnoques Avatar asked Dec 09 '10 19:12

Arnoques


3 Answers

Look at Qt Graphics View Framework, it is supported in PyQt4. Another option is to use OpenGL which will require more code but provide more flexibility and hardware acceleration (also supported in PyQt4).

like image 134
vls Avatar answered Sep 28 '22 19:09

vls


Look at the library gaphas, it implements object resize/move/edit by default, so it is quick to start with.

like image 44
u0b34a0f6ae Avatar answered Sep 28 '22 18:09

u0b34a0f6ae


One option is GooCanvas and the Python bindings for it. GooCanvas

like image 44
Keith Avatar answered Sep 28 '22 18:09

Keith