views:

49

answers:

3

hello
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

+1  A: 

Check out Qt painting class: http://doc.qt.nokia.com/4.6/qpainter.html

Kamil Klimek
QPainter is for vector drawing, not bitmaps as in MS Paint.
Simon Hibbs
But you can easily achieve MS Paint functionality with QPainter. You can load QBitmap, create QPainter on it, draw what you need, and save it as bitmap
Kamil Klimek
+3  A: 

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.

Simon Hibbs
A: 

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

xioxox