Load an image from a zip ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • mtrx
    Forum Member
    • Sep 2009
    • 32

    Load an image from a zip ?

    Hello,
    its possible to Load an image from a zip ?
    if yes maybe a example
    thank you
  • colc
    Forum Member
    • Aug 2011
    • 454

    #2
    You should just use zip extract then image load.
    It is ALL in the manual.
    Here is a Demo:
    zipAddExtract.zip

    PS: Click my logo to reveal Code

    Comment

    • mtrx
      Forum Member
      • Sep 2009
      • 32

      #3
      colc
      Thank you for reply...
      I want to display an image directly from the zip file without extracting it.
      i know with luazip for text and want to do it with image
      best regard


      Comment

      • pearce
        Forum Member
        • Aug 2022
        • 6

        #4
        You can use ImageScroller , one problem is that ImageScroller is not in the background that a text input or paragraph can be made over it. or someone knows a solution here.



        Comment

        • Old Fellow
          Forum Member
          • Jan 2014
          • 154

          #5
          This intrigues me.

          Decided to see if I could list the contents of a zip file. Using 7Zip I found out the simple command line to list the files of a zip file.

          I built a very simple AMS project to see if I could have a go at this and so far I have the following script

          Code:
          zip_file_name = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
          
          command1 = "AutoPlay\\Docs\\7-Zip\\7z.exe "-- Note the gap after the letter Z and the "
          command2 = "l " -- Note the bap after the letter l and the "
          command3 = zip_file_name[1]
          
          fullcommand = command1 ..command2 .. command3
          CommandOutput = CommandLine.Execute(command1 ..command2 .. command3, 0);
          
          local my_string = (CommandOutput.StdOut);
          local all_lines = {};
          for line in my_string:gmatch("[^\r\n]+") do
          all_lines[#all_lines + 1] = line;    
          result = ListBox.AddItem("ListBox1", line, "");
          end
          It adds the list of a zip file into a ListBox. I know this is not exactly what you are looking for but I think it might only be a small jump to click on the list box say of a jpg image and to load that image into a image object.

          I will work on this some more when I get time..

          Sounds fun...

          Comment

          • Old Fellow
            Forum Member
            • Jan 2014
            • 154

            #6
            Well seems I have hit a wall.

            If a zip file is opened with 7Zip you can select a file within the zip file, a jpg image for instance, double click on this image and it will open in the explorer window.
            I have been trying to find a command for that but I am unable to. It might not even exist ?

            If there had have been a certain command I feel sure it could have been done in AMS.

            Comment

            • Imagine Programming
              Indigo Rose Customer
              • Apr 2007
              • 4248

              #7
              Originally posted by Old Fellow View Post
              Well seems I have hit a wall.

              If a zip file is opened with 7Zip you can select a file within the zip file, a jpg image for instance, double click on this image and it will open in the explorer window.
              I have been trying to find a command for that but I am unable to. It might not even exist ?

              If there had have been a certain command I feel sure it could have been done in AMS.
              It's quite possible, however not without extensions. Extracting an image from zip directly to a visual control cannot be done in AMS, you need to store the file on disk first. If that's a problem, you need something to extract it from the zip file to a buffer. You then need a plugin that can decode an image from buffer and show it. I've done this in the past, I wrote a plugin called microzip or something for just one usecase.
              Bas Groothedde
              Imagine Programming :: Blog

              AMS8 Plugins
              IMXLH Compiler

              Comment

              • Imagine Programming
                Indigo Rose Customer
                • Apr 2007
                • 4248

                #8
                Is this what you mean? It does require MemoryEx and Draw.
                Attached Files
                Bas Groothedde
                Imagine Programming :: Blog

                AMS8 Plugins
                IMXLH Compiler

                Comment

                • Old Fellow
                  Forum Member
                  • Jan 2014
                  • 154

                  #9
                  Originally posted by Imagine Programming View Post
                  Is this what you mean? It does require MemoryEx and Draw.

                  That is pretty neat...

                  I added my own Pics.zip file into the mix and it works a treat.
                  The OP should be well happy with that...

                  Comment

                  Working...
                  X