Pictures as a medium for binary data
Pondering how we could solve the mysterious case of alien data (i.e when you got a binary file that you dont want to hand-punch as an array), I realized that we could use pictures as a medium. It wont help loading files from the device (unless you compile to phonegap), but it will help with converting files from Delphi to HTML5. While I can only speculate on the maximum size we can get and the differences between mobile and stationary webkit (behind Apple’s “bling” it’s all unix after all), –under winAPI a DIB (device independent bitmap) has a max size of 4096 x 4096 x 32 bits – which yields a total of 67108864 bytes of storage space. I think you can go higher if you throw in a memory mapped file handle – but it’s been a while since I hacked around the winAPI to be honest. I got sick of the whole limitation and coded my own system (see “uni-surface” under pixelrage).
So, right now im adding a new wizard to Smart Mobile which allows you to embed a binary file as a picture. Instead of RGBA pixel data, we write the bytes from the file – and you can read them out via a normal TW3ImageData object.
Thanks to Kostas for the head’s up!
Spirit of Delphi
On a second note, my main man Dorin is ever pushing limits to the max and have released an awesome example of source code mini maps for synEdit. With some of the killer stuff Dorin is knocking out these days — he will probably take over the world in 10 years time. Head over to the spirit of Delphi and check out his top-notch stuff!