Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Combining Images sided by side using QPainter and QImage

$
0
0
Hi everyone, I’m a beginner when it comes to using Qt and I’m having some problems combining two images by using QImage and QPainter. The code I use is below.   QImage image1("C:\\Documents and Settings\\Macavelly\\My Documents\\Downloads\\images\\color\\col1.jpg");     QImage image2("C:\\Documents and Settings\\Macavelly\\My Documents\\Downloads\\images\\color\\col2.jpg");     QImage result(image1.width() + image2.width(), image1.height() ,QImage::Format_RGB32);         QPainter painter;     painter.begin(&result);     painter.drawImage(0, 0, image1);     painter.drawImage(512, 0, image2);     painter.end();       result.save("C:\\Documents and Settings\\Macavelly\\My Documents\\Downloads\\images\\color\\com.jpg",0,100); Image 1 and 2 both are the same width and height. The program compiles but crashes as soon as it launches. Thanks in advance for any help.

Viewing all articles
Browse latest Browse all 18427

Trending Articles