
Help: Bload, Bsave, Put, Get
Quote:
>Can someone tell me how I can load more than one bsaved picture in a
>dimensional variable? Any help would be appreciated.
It's fairly simple, but there are a few things to look out for. First,
BSAVE and
BLOAD can unfortunately only be used on arrays of 64K or less, so u can't
use them for arrays which are too big. It's really no different from an
array
with 1 pic, except that u have to make sure u have the number of bytes to be
saved correct.
a quick eg:
------
DEFINT A-Z
SCREEN 13
CONST PicSize = 202 ' say 20 x 20 each
CONST NumPics = 10
DIM Array(0 to NumPics * PicSize - 1) AS INTEGER
' get pics into array
' eg: to get an image into the 7th slot in the array
PicNum = 7
GET (50, 50)-(69, 69), Array(PicNum * PicSize)
' saving the pics
DEF SEG = VARSEG(Array(0))
BSAVE "File1.dat", VARPTR(Array(0), PicSize * 2 * NumPics
. . . . .
' loading the pics:
DEF SEG = VARSEG(Array(0))
BLOAD "File1.dat", VARPTR(Array(0))
' now the array has the same data in it as when you saved it.
------
-dk