taximania Well-Known Member Licensed User Longtime User Apr 13, 2009 #1 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.
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.
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2009 #2 You can use BinaryFile.ReadBytes to read an array of bytes into a single dimension array.
taximania Well-Known Member Licensed User Longtime User Apr 16, 2009 #3 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
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
Erel B4X founder Staff member Licensed User Longtime User Apr 16, 2009 #4 Is it possible to save more than 1 single dimension array to the same file ? Click to expand... No. However you can always imitate a 2 dimension array with a single dimension array. B4X: Dim arr2 (m, n) => Dim arr1 (m * n) arr(x, y) => arr1 (x * m + y)
Is it possible to save more than 1 single dimension array to the same file ? Click to expand... No. However you can always imitate a 2 dimension array with a single dimension array. B4X: Dim arr2 (m, n) => Dim arr1 (m * n) arr(x, y) => arr1 (x * m + y)