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. How to save and load image in qt

How to save and load image in qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 2 Posters 669 Views
  • 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 Offline
    U Offline
    UG SEP
    wrote on last edited by
    #1

    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

    jsulmJ 1 Reply Last reply
    0
    • U UG SEP

      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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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
      1
      • U Offline
        U Offline
        UG SEP
        wrote on last edited by
        #3

        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

        jsulmJ 1 Reply Last reply
        0
        • U UG SEP

          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

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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
          0
          • U Offline
            U Offline
            UG SEP
            wrote on last edited by
            #5

            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

            jsulmJ 1 Reply Last reply
            0
            • U UG SEP

              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

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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
              1
              • U Offline
                U Offline
                UG SEP
                wrote on last edited by
                #7

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

                his format? I

                my own

                jsulmJ 1 Reply Last reply
                0
                • U UG SEP

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

                  his format? I

                  my own

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @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
                  1
                  • U Offline
                    U Offline
                    UG SEP
                    wrote on last edited by
                    #9

                    it's a text format

                    jsulmJ 2 Replies Last reply
                    0
                    • U UG SEP

                      it's a text format

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @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
                      1
                      • U UG SEP

                        it's a text format

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @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
                        1

                        • Login

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