Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Create a pixmap from a QQuickItem (in Qt5)
Forum Updated to NodeBB v4.3 + New Features

Create a pixmap from a QQuickItem (in Qt5)

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 3.0k 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.
  • S Offline
    S Offline
    Sfiet_Konstantin
    wrote on last edited by
    #1

    I wanted to create a pixmap from a QQuickItem (or a QML item and all it's children). What I want is like to take a screenshot of this Item, and store it in a QPixmap / QImage.

    With Qt4, it was easy to paint the item into a QPixmap, but with the new Scenegraph, I don't know how to proceed, so is this possible and how can we do this ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Charles
      wrote on last edited by
      #2

      You can use the "QImage QQuickCanvas::grabFrameBuffer();" method to grab the whole visible canvas region and copy out the item rect.

      Here is an example shows how you can grab an item as QImage:

      http://qt.gitorious.org/qt/qtdeclarative/blobs/master/src/qmltest/quicktestresult.cpp#line589

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sfiet_Konstantin
        wrote on last edited by
        #3

        Nice, thanks, I will definitely check that

        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