Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Replaying a QPicture, coordinate transformations
Forum Updated to NodeBB v4.3 + New Features

Replaying a QPicture, coordinate transformations

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jens.mueller
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jens.mueller
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved