Results 1 to 6 of 6

Thread: Saving Image from QML

  1. #1
    Join Date
    May 2017
    Posts
    15
    Qt products
    Qt5
    Platforms
    Windows

    Default Saving Image from QML

    Hello!!

    I am using Qt 4.3.2 and I am trying to save Image Element in QML. For saving the image I tried grabtoImage but couldn't get the result. I really appreciate it if anyone could help me.

    Here is the code:

    import QtQuick 2.6
    import QtQuick.Window 2.2

    Window {
    id:source
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")



    Image {
    id: visualImage
    source: "L1.png"
    Text {
    id: buttontext
    x:40
    y:20
    font.bold: true
    font.pointSize: 24
    text: "R1"
    }
    }

    }

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Saving Image from QML

    Are you sure you are using Qt 4.3.2? QtQuick 2.6 import seems to indicate you're using at least Qt 5.6.

    How is the code you posted related to the problem?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2017
    Posts
    15
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Saving Image from QML

    Hello!! Thank you for the response. It's not about the versions. As you can see from the code I have an Image and I want to Save that Image.
    Last edited by Veera; 2nd June 2017 at 07:18.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Saving Image from QML

    It's all about the versions because QtQuick 2 is totally different than QtQuick 1.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2017
    Posts
    15
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Saving Image from QML

    Sorry, I have 2 versions. My Qt quick is 2.6 and the version I am using is Qt 5.8. Could you help me with the solution?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Saving Image from QML

    There is no easy way to grab a single item in QtQuick 2. You can only render the complete scene to an offscreen buffer (FBO) and convert that to an image. But that's going to contain the whole scene, not a single item.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Image Saving Problem
    By WarGamer in forum Qt Programming
    Replies: 5
    Last Post: 30th July 2012, 20:35
  2. Problem saving JPG image
    By avis_phoenix in forum Newbie
    Replies: 1
    Last Post: 31st July 2009, 15:38
  3. Saving qwt plot as image
    By giusepped in forum Qwt
    Replies: 13
    Last Post: 14th July 2009, 07:39
  4. Regarding saving of image in QTOPIA sdk
    By prajna in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 22nd April 2009, 06:45
  5. Saving already opened image ...
    By Godlike in forum Newbie
    Replies: 14
    Last Post: 28th March 2006, 21:17

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.