Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved How to save and load image in qt

    General and Desktop
    2
    11
    222
    Loading More Posts
    • 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.
    • U
      UG SEP last edited by

      Hey,
      If we share.doc file with anyone then also we can see the image so can I know how to save an image in qt so it can be used by anyone i.e. those who don't have the image inside the file

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @UG SEP last edited by

        @UG-SEP said in How to save and load image in qt:

        those who don't have the image inside the file

        What file? Can you please explain better what you want to do?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 1
        • U
          UG SEP last edited by

          Let think you are my friend and I want to send you a file of my own extension .hmt with the software and in that file, an image exists (The program open the image by its location) so if you open it then the image is not visible to you so can you tell me how can I assign an image in an object and then I save the object in a file and then read the object while writing the file...
          Hope you understand

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @UG SEP last edited by

            @UG-SEP said in How to save and load image in qt:

            so can you tell me how can I assign an image in an object

            I still don't understand what you mean. What object?
            Are you talking about HTML file + images?
            How does this "object" (whatever it is) access this image?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • U
              UG SEP last edited by

              Ok so,
              you have seen that whenever we send a .doc file in which some images are there so anyone can see that image if we send him the .doc file so how can I create so that if I also send my .hmt extension file to someone so he or she can see that image inside the file

              jsulm 1 Reply Last reply Reply Quote 0
              • jsulm
                jsulm Lifetime Qt Champion @UG SEP last edited by

                @UG-SEP said in How to save and load image in qt:

                .hmt extension file to someone so he or she can see that image inside the file

                It depends on the format of that htm file.
                What is this format? Is it your own format? Or something existing?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply Reply Quote 1
                • U
                  UG SEP last edited by

                  @jsulm said in How to save and load image in qt:

                  his format? I

                  my own

                  jsulm 1 Reply Last reply Reply Quote 0
                  • jsulm
                    jsulm Lifetime Qt Champion @UG SEP last edited by

                    @UG-SEP Well, then you can decide how to include images. I have no idea how your format is defined. You did not even tell us whether it is text or binary format.
                    For example docx from Microsoft Word is a zip archive containing XML files and images (and what else is part of the document). The images are referenced in XML files then.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply Reply Quote 1
                    • U
                      UG SEP last edited by

                      it's a text format

                      jsulm 2 Replies Last reply Reply Quote 0
                      • jsulm
                        jsulm Lifetime Qt Champion @UG SEP last edited by

                        @UG-SEP Then you can simply put the image file next to htm file and send both together.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply Reply Quote 1
                        • jsulm
                          jsulm Lifetime Qt Champion @UG SEP last edited by

                          @UG-SEP An alternative would be to encode the image content as BASE64 and put this BASE64 string in your text file.
                          But I would not do this for bigger images.

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post