Erel has mentioned several times that the BinaryFile.dll can be used to store bitmap images. Using them, however, takes a little doing. You can randomly access any image with this code (assume your object is named Img):
Img.position = Pos
Image1.Image=Img.RetrieveImage
Where Pos is the position of the image in the data file -- 78848 for example, and Image1 is the control that the image is being read to (it could also be an image button, an ImageList, or any control that takes an image). The problem is knowing the correct value of Pos for any given image.
Image Explorer is a tool for reading an image library created using BinaryFile, and give various pieces of information -- see the screen shot. When run, the program begins by asking you to pick the image file to be opened. Make sure you put the sample image file (Images.dat) in a directory accessible by your PPC.
Image Explorer does refuse to read past the end of the binary file so as to avoid crashing, but does not check on whether the file loaded is a valid BinaryFile.dll - generated file. Trying to run Image Explorer against any other type of input will probably cause a crash so be careful.
EREL:
(1) Is there a way to tell if the file being opened is a legitimate image file? I suppose I could read the first few bytes and look for "BM" but I thought maybe you would have a better way.
(2) I detect which image is the last by comparing the file size to the position after loading the image. The first image file I tested the position was exactly the same as the file size. The second image file was 8 bytes shorter than the file size. The program above compares the file size to the last position + 32. Is this a reliable method, or is there a better way?
dlfallen