Loadimage (or anything) from memory

BlitzMax Forums/BlitzMax Programming/Loadimage (or anything) from memory

BlitzProg(Posted 2010) [#1]
Is it possible to load an image from memory?

My aim is to have a crypted ressource being decrypted by a game and then being loaded. ^_^

What is the simplest way to do this?

(Note: Bmax 1.24 - can't upgrade because of project compatibility issue ;) )


ziggy(Posted 2010) [#2]
Use a bank and load the image from there. LoadImage() accept a memory bank as a parameter.


Czar Flavius(Posted 2010) [#3]
Or load it as a pixmap, you can load images from pixmaps too.


BlitzProg(Posted 2010) [#4]
Oh great, it works with memory banks!! Couldn't hope for anything better (if only i realised this earlier...!)

imagebank:TBank = LoadBank ("image.bmp")
image=LoadImage(imagebank)

Graphics 640,480,0,60

Cls
DrawImage image,0,0
Flip

WaitKey()


It says in the docs that url can be either a string or an existing pixmap. If only i knew that it also accepted banks, I wouldn't have bothered Incbining stuff!! lol

Thanks you very much.