Results 1 to 2 of 2

Thread: Array of bitmaps

  1. #1

    Thread Starter
    Join Date
    Mar 2006

    Array of bitmaps

    Is it possible to have an array of bitmaps. If so how can you save a bitmap to an array? In other words if you declare the array as a bitmap would you use the name given to the bitmap or just save the bitmap directly into the array?
    Thank you

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Sydney, Australia

    Re: Array of bitmaps

    An array of Bitmaps is just like an array of anything else. If you aren't sure how to handle arrays then you should visit the Start VB.NET link in my signature and read the Array section.
    VB Code:
    1. Dim pictures(10 - 1) As Bitmap 'create an array that can hold 10 Bitmaps
    3. pictures(0) = New Bitmap("C:\Image.bmp") 'create a new Bitmap object and assign it to the first element of the array.
    If you want to be able to refer to the Bitmaps by name then you could use an ImageList (assuming that you're using VB 2005, please specify in future) or a keyed collection of some sort (SortedList, Hashtable, etc.).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width