PDA

View Full Version : How could I do a copy from an image and make some changes??



TeresaML
29th November 2009, 20:04
I've loaded an image (QImage) in a frame by means of: frame->image.load(fileName);

I would like to create a copy (if it's possible without saving it) from this image and make some changes in the image and show it again once it has been modified, but I don't know how to do it... because I use paintevent and I think that the paintevent repaint the image all the time, without represented the changes.

wysota
29th November 2009, 20:33
I don't know what your "frame" is, but QImage::copy() returns a copy of the image. QImage class itself can be copied, so to have a copy of the image it is enough to have a copy of the object holding it.

QImage img;
img.load(...);
QImage copyOfImg = img;