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. How to export qml map with all of its items into a image?
Qt 6.11 is out! See what's new in the release blog

How to export qml map with all of its items into a image?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 1.2k Views 2 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.
  • AlienA Offline
    AlienA Offline
    Alien
    wrote on last edited by
    #1

    Hi,

    I wonder if there is any way to produce an image (which can save on disk) out of a map qml component with all of its items.

    
    Map {
        id: map
        zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
        center {
            // The Qt Company in Oslo
            latitude: 59.9485
            longitude: 10.7686
        }
        MapCircle {
            id: point
            radius: 1000
            color: "#46a2da"
            border.color: "#190a33"
            border.width: 2
            smooth: true
            opacity: 0.25
            center: locationData.coordinate
        }
    ...
    }
    

    I appreciate any help

    1 Reply Last reply
    0
    • AlienA Alien

      Dear @mrjj
      Thanks for your reply what i mean is exporting the current view of map component with all of its items something similar to screenshot. Screenshot takes photo of the screen which is not adequate for my purpose due to the fact that it takes other components which aren't relevant. Having said that, if there is no way to capture the map component and export it, any suggestion about taking screenshot will be appreciated.

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #4

      @Alien
      Hi
      Its only suggestions as im not QML expert,
      so it's more what seen on the forum etc.

      I was thinking of using
      https://doc.qt.io/qt-5/qml-qtquick-item.html#grabToImage-method
      but im not sure if map supports it.
      else something like
      https://stackoverflow.com/questions/21307773/taking-screenshot-from-inside-fullscreen-qt-quick-application

      AlienA 1 Reply Last reply
      3
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi
        Would a screen shot do it for you ?

        AlienA 1 Reply Last reply
        0
        • mrjjM mrjj

          Hi
          Would a screen shot do it for you ?

          AlienA Offline
          AlienA Offline
          Alien
          wrote on last edited by
          #3

          Dear @mrjj
          Thanks for your reply what i mean is exporting the current view of map component with all of its items something similar to screenshot. Screenshot takes photo of the screen which is not adequate for my purpose due to the fact that it takes other components which aren't relevant. Having said that, if there is no way to capture the map component and export it, any suggestion about taking screenshot will be appreciated.

          mrjjM 1 Reply Last reply
          0
          • AlienA Alien

            Dear @mrjj
            Thanks for your reply what i mean is exporting the current view of map component with all of its items something similar to screenshot. Screenshot takes photo of the screen which is not adequate for my purpose due to the fact that it takes other components which aren't relevant. Having said that, if there is no way to capture the map component and export it, any suggestion about taking screenshot will be appreciated.

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #4

            @Alien
            Hi
            Its only suggestions as im not QML expert,
            so it's more what seen on the forum etc.

            I was thinking of using
            https://doc.qt.io/qt-5/qml-qtquick-item.html#grabToImage-method
            but im not sure if map supports it.
            else something like
            https://stackoverflow.com/questions/21307773/taking-screenshot-from-inside-fullscreen-qt-quick-application

            AlienA 1 Reply Last reply
            3
            • mrjjM mrjj

              @Alien
              Hi
              Its only suggestions as im not QML expert,
              so it's more what seen on the forum etc.

              I was thinking of using
              https://doc.qt.io/qt-5/qml-qtquick-item.html#grabToImage-method
              but im not sure if map supports it.
              else something like
              https://stackoverflow.com/questions/21307773/taking-screenshot-from-inside-fullscreen-qt-quick-application

              AlienA Offline
              AlienA Offline
              Alien
              wrote on last edited by
              #5

              Dear @mrjj
              Thanks a lot that was exactly what I'm looking for.

              Yours,

              1 Reply Last reply
              1

              • Login

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