Image Array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • padt
    New Member
    • Nov 2008
    • 1

    Image Array

    How do I create an image array in c# if this is possible? or would i be best using an ImageList?

    I am new to programming and am writing a simple code where the image will change once I click a button.
  • joedeene
    Contributor
    • Jul 2008
    • 579

    #2
    I'd recommend using the ImageList Class. But to make an Array of the Image Class then that would be a simple line of code like this;

    Code:
     Image[] imageArray = new Image[20];
    joedeene

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Originally posted by joedeene
      I'd recommend using the ImageList Class. But to make an Array of the Image Class then that would be a simple line of code like this;

      Code:
       Image[] imageArray = new Image[20];
      joedeene
      An image[], no matter if its a list or an array could become very memory hungy. 20+ bitmaps are big.

      You might consider a string array (or list) with the path names. Then you load one image at a time, keeping down the memory overhead

      Comment

      Working...