开发者

making paint in pyqt or qt [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_运维百科

Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.

Closed 9 years ago.

Improve this question

i have just received a task to implement a software that paints over pictures (pretty much like microsoft paint )

i have no idea where to start or how to do that. do anyone have a good reference or idea for painting in qt or pyqt ?

this will be highly appreciated thanks in advance


You'll be working with the QImage class, which represents bitmap images. It has methods for changing the colour at a given pixel using setPixel. There is am Image Viewer Example provided with Qt and PyQT should come with the same example in Python. However it uses a Qlabel to display the image so you may want to use a different widget, perhaps a custom QWidget subclass. You can start with that and add functionality to detect the mouse position in the , mouse clicks, etc and change the colours.


Check out Qt painting class QPainter: https://doc.qt.io/archives/qt-4.7/qpainter.html


Have you looked at the scribble example included in PyQt? It does basic drawing, saving, loading, etc.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜