Saving Array's to a single file ?

Discussion in 'Questions (Windows Mobile)' started by taximania, Apr 13, 2009.

  1. taximania

    taximania Well-Known Member Licensed User

    I'm reading an 84wide x 48height .bmp image into a series of bytes.
    The data is read into an array(6,84) so far so good.

    How can I save a series of arrays (image data) to a single file so that I can retreive each one randomly, not sequentially.

    e.g. FileRead(c,array(),3)
    4th image in the file.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use BinaryFile.ReadBytes to read an array of bytes into a single dimension array.
     
  3. taximania

    taximania Well-Known Member Licensed User

    Works a treat, 1 image to 1 file. Much faster than I thought it would be.
    Reading and writing :)

    Is it possible to save more than 1 single dimension array to the same file ?
    I've checked the helpfiles and it doesn't look possible.


    Just asking incase I misread things, cheers :)
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    No. However you can always imitate a 2 dimension array with a single dimension array.
    Code:
    Dim arr2 (m, n) => Dim arr1 (m * n)
    arr(x, y) => arr1 (x * m + y)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice