after the above code
//code in worker thread
painter.save();
//painting is performed
painter.restore();
QPainter painter(&image);
painter.save();
//painting is performed
painter.restore();
To copy to clipboard, switch view to plain text mode
//code in main gui thread.
pixmap
=QPixmap::fromImage(worker_thread.
image);
//image is converted to pixmapupdate();//inside the paintevent the pixmap is painted on to widget.
pixmap=QPixmap::fromImage(worker_thread.image);//image is converted to pixmap
update();//inside the paintevent the pixmap is painted on to widget.
To copy to clipboard, switch view to plain text mode
i get black as the background color.
But if any color is given(instead of Qt::transparent) such as green then green color is the background color
image.fill(colormap.pixel(Qt::green));
image.fill(colormap.pixel(Qt::green));
To copy to clipboard, switch view to plain text mode
Bookmarks