I'm trying to create a scrolling effect for painting done in a QPixmap, using a function that takes a pixmap and paints it into itself with the required deltas:
void scrollGraphics
(int dx,
int dy,
QPixmap *thePixmap
) {
p.begin(thePixmap);
p.drawPixmap(dx, dy, *thePixmap);
p.end();
}
void scrollGraphics(int dx, int dy, QPixmap *thePixmap)
{
QPainter p;
p.begin(thePixmap);
p.drawPixmap(dx, dy, *thePixmap);
p.end();
}
To copy to clipboard, switch view to plain text mode
If dx and/or dy < 0, the graphics of thePixmap appear shifted by the correct amount. However, if I pass a value greater than 0 for dx and/or dy, drawPixmap() paints into thePixmap multiple shifted copies of itself.
Is this a Qt bug? Or am I missing something?
Bookmarks