QT图像绕中心点旋转

qt旋转很有意思,需要设定选择逆转中心点,然后还要恢复中心点。



java

 QPixmap pix3;


    pix3.load(":/fengche.png");

    movie_step=movie_step+1.5*message_rev.fengsu1;
    painter.translate(400,270);
    painter.rotate(movie_step);
    painter.translate(-400,-270);
    painter.drawPixmap(300, 170, 200, 200, pix3);

c++

 QPixmap pix3;


    pix3.load(":/fengche.png");

    movie_step=movie_step+1.5*message_rev.fengsu1;
    painter.translate(400,270);
    painter.rotate(movie_step);
    painter.translate(-400,-270);
    painter.drawPixmap(300, 170, 200, 200, pix3);




你可能感兴趣的:(QT图像绕中心点旋转)