
Originally Posted by
yellowmat
I think I must code something like this :
...
but how to determine x and y ?
Try:
int x = m_pBackground->width() / 2; // or width() if it's the same
int y = m_pBackground->height() / 2;
painter.drawPixmap(0, 0, *m_pBackground);
painter.translate(-x, -y);
painter.rotate(m_dAngle);
painter.translate(x, y);
painter.drawPixmap(0, 0, *m_pForeground);
int x = m_pBackground->width() / 2; // or width() if it's the same
int y = m_pBackground->height() / 2;
painter.drawPixmap(0, 0, *m_pBackground);
painter.translate(-x, -y);
painter.rotate(m_dAngle);
painter.translate(x, y);
painter.drawPixmap(0, 0, *m_pForeground);
To copy to clipboard, switch view to plain text mode
Bookmarks