python 的交互式矢量图形画布?
我正在用 Python 编写一个小型应用程序,我希望用户能够在画布上放置、移动、旋转等不同的对象。有没有什么方法可以在不进行大量编码的情况下实现这一目标?我是在空闲时间做这件事的,而且我对 PyQt 的经验有限。
这基本上就是任何矢量图形编辑器的作用(即 Inkscape、Corel Draw 或 Dr. Geo):它们提供用户可以通过手柄来移动、拉伸和旋转对象。我想知道是否有任何小部件或任何已经提供句柄和基本操作的东西,所以我只需要实现程序对这些操作的反应。
由于我计划在免费许可证下发布它(如果我达到发布的地步),任何开源许可证都会很棒。
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看Qt Graphics View Framework,PyQt4中支持它。另一种选择是使用 OpenGL,它需要更多代码,但提供更多灵活性和硬件加速(也PyQt4 支持)。
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).
一种选择是 GooCanvas 及其 Python 绑定。
GooCanvas
One option is GooCanvas and the Python bindings for it.
GooCanvas
看一下库gaphas,它默认实现了对象resize/move/edit,所以上手很快和。
Look at the library gaphas, it implements object resize/move/edit by default, so it is quick to start with.