Results 1 to 3 of 3

Thread: Can an Array store information about images - i.e. file name.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    20

    Can an Array store information about images - i.e. file name.

    Can an Array store information about images - i.e. file name and location and have the capability of displaying the image at runtime?

    thanks

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Can an Array store information about images - i.e. file name.

    An array wouldn't be able to store an image (not a big one anyway). It can hold filenames and the like, but if you wanted it to store small images you could save the contents of the image into the array, and save it like so:
    VB Code:
    1. Dim flnum As Long
    2.  
    3. flnum = FreeFile()
    4.  
    5. Open "image.format" For Binary Access Write As #flnum
    6. Put #flnum,, arraywithcontents(index)
    7. Close #flnum
    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: Can an Array store information about images - i.e. file name.

    Quote Originally Posted by ourplace85
    Can an Array store information about images - i.e. file name and location and have the capability of displaying the image at runtime?

    thanks
    yah... as the filename and file location are string in nature they can be saved in a string array... and if you want to save the images in an array... this is also possible using byte array... but i won't recommend that ...because then reading that byte stream to paint the image is really a heck...

    well... what i suggest.. you take an Image Control Array......


    if you choose otherwise.... and you want to display images using their filename stored in an array you can do like this

    Image1.Picture = LoadPicture(ImgPaths(2))

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