painter.
setRedirected (this,
&backGround,
QPoint(0,
0));
painter.setWindow( 0, 0, pixcols - 1, pixrows - 1);
// bunch of painter commands
painter.
setRedirected (&backGround,
this,
QPoint(0,
0));
if(backGround.save(file, "PGN", -1))
qDebug("it worked");
else
qDebug("it didn't work");
painter.setWindow( 0, 0, pixcols - 1, pixrows - 1);
QRect rect
(0,
0, pixcols
- 1, pixrows
- 1);
painter.drawImage(rect, backGround, rect);
QPainter painter(this);
QImage backGround;
painter.setRedirected (this, &backGround, QPoint(0, 0));
painter.setWindow( 0, 0, pixcols - 1, pixrows - 1);
// bunch of painter commands
painter.setRedirected (&backGround, this, QPoint(0, 0));
QString file = "image.png";
if(backGround.save(file, "PGN", -1))
qDebug("it worked");
else
qDebug("it didn't work");
painter.setWindow( 0, 0, pixcols - 1, pixrows - 1);
QRect rect(0, 0, pixcols - 1, pixrows - 1);
painter.drawImage(rect, backGround, rect);
To copy to clipboard, switch view to plain text mode
Bookmarks