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. Loading multiple image files

Loading multiple image files

Scheduled Pinned Locked Moved C#
question
5 Posts 3 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.
  • O Offline
    O Offline
    Os Sutrisno
    wrote on last edited by
    #1

    Hi all! I'm trying to load several image files into a form. These files may overlap and can be moved by up, down, left and right button controls. How can I achieve this? Do I have to use picture boxes? Can one picture box contain several images? Thanks!;)

    T 1 Reply Last reply
    0
    • O Os Sutrisno

      Hi all! I'm trying to load several image files into a form. These files may overlap and can be moved by up, down, left and right button controls. How can I achieve this? Do I have to use picture boxes? Can one picture box contain several images? Thanks!;)

      T Offline
      T Offline
      therealmccoy
      wrote on last edited by
      #2

      You can load your pictures into an array of type Image or BitMap and then assign the element of the array that contains the picture you want to display to the image property of the PictureBox. Loading the pictures into an array allows you to quickly change the picutures (without have to load each one from a file, all done when you load them into the array) I think you could also use an ImageList (control), but I'm guessing and have not had much luck with it's implimentation. Last time I used it I have a problem with my pictures being reformatted and never looked into it. www.lovethosetrains.com

      O 1 Reply Last reply
      0
      • T therealmccoy

        You can load your pictures into an array of type Image or BitMap and then assign the element of the array that contains the picture you want to display to the image property of the PictureBox. Loading the pictures into an array allows you to quickly change the picutures (without have to load each one from a file, all done when you load them into the array) I think you could also use an ImageList (control), but I'm guessing and have not had much luck with it's implimentation. Last time I used it I have a problem with my pictures being reformatted and never looked into it. www.lovethosetrains.com

        O Offline
        O Offline
        Os Sutrisno
        wrote on last edited by
        #3

        Thanks, array is a great idea! I never thought of that :~ Newbie here X| Regarding PictureBoxes, if I want to load multiple images, I have to use one PictureBox for each correct? Is PictureBox or using Graphics class a better way to approach this?

        R 1 Reply Last reply
        0
        • O Os Sutrisno

          Thanks, array is a great idea! I never thought of that :~ Newbie here X| Regarding PictureBoxes, if I want to load multiple images, I have to use one PictureBox for each correct? Is PictureBox or using Graphics class a better way to approach this?

          R Offline
          R Offline
          Rizwan Bashir
          wrote on last edited by
          #4

          Use and array of picturebox. So no matter how many images you want to load you can extend the picturebox array accordingly.

          O 1 Reply Last reply
          0
          • R Rizwan Bashir

            Use and array of picturebox. So no matter how many images you want to load you can extend the picturebox array accordingly.

            O Offline
            O Offline
            Os Sutrisno
            wrote on last edited by
            #5

            Hmm, I'm starting to get this :-D Thanks guys!

            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