Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to navigate inside a folder from picture to picture

How to navigate inside a folder from picture to picture

Scheduled Pinned Locked Moved C#
helptutorial
7 Posts 4 Posters 0 Views 1 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.
  • K Offline
    K Offline
    kKamel
    wrote on last edited by
    #1

    Hello I need to view pictures of a file now this file has many pictures i need a way to access the first picture then navigate to the last one, the problem is that the images are not numeric named so i cant increment number to access the other image please help.

    OriginalGriffO L S K 4 Replies Last reply
    0
    • K kKamel

      Hello I need to view pictures of a file now this file has many pictures i need a way to access the first picture then navigate to the last one, the problem is that the images are not numeric named so i cant increment number to access the other image please help.

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      What have you tried? What are they named? Do you have an index of some sort?

      No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      K 1 Reply Last reply
      0
      • K kKamel

        Hello I need to view pictures of a file now this file has many pictures i need a way to access the first picture then navigate to the last one, the problem is that the images are not numeric named so i cant increment number to access the other image please help.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        string[] picFiles = Directory.GetFiles(@"D:\PICS");
        foreach (string picFile in picFiles)
        {
        pictureBox1.Image = Image.FromFile(picFile);
        MessageBox.Show("Press OK for next picture...");
        }

        The pictures are unsorted. If you don't have any index, then sort "picFiles" to date and time.

        1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          What have you tried? What are they named? Do you have an index of some sort?

          No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

          K Offline
          K Offline
          kKamel
          wrote on last edited by
          #4

          i am trying DirectoryInfo class to get the files inside of it in file info array then i would iterate around them but am facing problems you cant know what the names of the picture bcz it is the client's disicion and there is no index or sort.

          OriginalGriffO 1 Reply Last reply
          0
          • K kKamel

            Hello I need to view pictures of a file now this file has many pictures i need a way to access the first picture then navigate to the last one, the problem is that the images are not numeric named so i cant increment number to access the other image please help.

            S Offline
            S Offline
            Saksida Bojan
            wrote on last edited by
            #5

            Hello, there is no need to put Bold on entire message. Your question conflicts with the title. Are you looking for next image in same folder or are you looking how to get next frame in Animated Image (GIF)? EDIT: I didn't saw other post, because my Firefox has cached and i saw old page. You don't need to know names of file. You can actualy parse the order. You coud by Character code. Also if you chose by date time, it desn't mean it will be accurate. If it was taken by camera, and you change batteries, there is possible date information could reset and new files coud have wrong DateTime

            1 Reply Last reply
            0
            • K kKamel

              Hello I need to view pictures of a file now this file has many pictures i need a way to access the first picture then navigate to the last one, the problem is that the images are not numeric named so i cant increment number to access the other image please help.

              K Offline
              K Offline
              kKamel
              wrote on last edited by
              #6

              well guys my testing on directoryInfo have seeded now i got the names of the picture now all i have to do is to change from one pic to onther in a web form. could any body suggest how to make that happen i was thinking of making a panel that changes its directory by either clicking forward or backward but how i could change a paned directory is ther something as a panel directory?? Or how about an update panel inside it there is a picture were i assign the picture every time i click.?

              1 Reply Last reply
              0
              • K kKamel

                i am trying DirectoryInfo class to get the files inside of it in file info array then i would iterate around them but am facing problems you cant know what the names of the picture bcz it is the client's disicion and there is no index or sort.

                OriginalGriffO Offline
                OriginalGriffO Offline
                OriginalGriff
                wrote on last edited by
                #7

                Then you will have to sort them by name, or create date. If the user doesn't catch on fairly quickly that sequential naming is a good idea if you want to find things, then spell it out to him when he compains...

                        DirectoryInfo di = new DirectoryInfo(@"c:\\XXTemp");
                        FileInfo\[\] fil = di.GetFiles();
                

                is the way to go.

                No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

                "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups