Replaying a QPicture, coordinate transformations



  • When I draw something in a QPicture, like in the "example in the documentation":http://doc.qt.nokia.com/4.7-snapshot/qpicture.html#details:
    @ QPicture picture;
    QPainter painter;
    painter.begin(&picture); // paint in picture
    painter.drawEllipse(10,20, 80,70); // draw an ellipse
    painter.end(); // painting done@

    and then replay it on another target, can I apply coordinate transformations before replaying the picture (like in the following), and will they have effect?

    @ painter.begin(&myImage); // paint in myImage
    painter.rotate(180.0);
    painter.drawPicture(0, 0, picture); // draw the picture at (0,0)
    painter.end(); // painting done@

    Besides, what is the performance impact of storing draw commands in a QPicture? Does someone have experience here?

    Best regards,

    Jens



  • OK, I tried it out.

    Yes, coordinate transformations are applied. Yes, it is at least much faster than our code that initially creates the paint commands.

    Best,

    Jens


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.