Load from ram ?

BlitzMax Forums/BlitzMax Programming/Load from ram ?

Filax(Posted 2005) [#1]
It is possible to read image file directly from a memory bank ? (please
don't talk to me about incbin :) ), because i'm making a packer ;) and
actualy if i want to load an image or pixmap from my pak file, i must
save it on disk before load ! (like blitz3D)

I have look under the doc and i have see some CreateRamSTream ?

It is possible to use ram stream for read image ? or is there another
way to di it ?


Robert(Posted 2005) [#2]
Yes, all of the LoadImage / LoadPixmap / LoadFont etc. commands accept streams as the object parameter.

Use CreateBankStream to create a stream from the bank which can then be passed to LoadImage.

TBankStream objects are 'wrappers' around banks which allow you to use stream commands like ReadByte, WriteByte etc. to read and write data from streams.


Filax(Posted 2005) [#3]
Many thanks for explain !


bregors(Posted 2005) [#4]
.


Grisu(Posted 2005) [#5]
Filax, could u use this loading info to make the imagebutton load from a stream too?