2010-08-30 163 views

回答

10

是的,使用QPainter來繪製一個QPaintDevice,QImage是一個QPaintDevice,所以它的工作原理。

27
QImage srcImage = QImage(100, 100); 
QImage destImage = QImage(200, 200); 
QPoint destPos = QPoint(25, 25); // The location to draw the source image within the dest 

srcImage.fill(Qt::red); 
destImage.fill(Qt::white); 

QPainter painter(&destImage); 
painter.drawImage(destPos, srcImage); 
painter.end();