PDA

View Full Version : Drawing a border around an image.



owenb11
15th April 2016, 13:32
I am looking to write a function which can be called into main which will draw a border around my image and then allow me to save this image to open later. I have all the code for saving and opening the image, i am however new to this and have no idea where to start with the function to draw the border.

I am also required to invert the image under the same circumstances, and by this i mean change all the 1 values to a 0 and vice versa.

Any help would be much appreciated.

anda_skoa
15th April 2016, 14:31
Create a QPainter that works on the image and call its draw methods.

Cheers,
_

owenb11
15th April 2016, 14:36
Thanks for the reply but i have no idea how to go about doing this.. would you be able to point me in the right direction?

d_stranz
15th April 2016, 16:30
Reading the Qt QPainter and QImage documentation and studying the examples (http://doc.qt.io/qt-5/examples-painting.html) would be a good place to start.