QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Dav on September 13, 2018, 08:31:32 pm

Title: Getting an image handle without _LOADIMAGE?
Post by: Dav on September 13, 2018, 08:31:32 pm
I'm trying to combine all resources my EXE program uses into a data pack (and attached to the compiled EXE).  It's easy to load data from the pack/exe as string data, but when it comes to using/loading the images I first have to save that image data to disk as a temporary image file so _LOADIMAGE can load it and give a handle to use.

Is there a way to convert a string (containing full image file data) to something _PUTIMAGE can use, bypassing _LOADIMAGE?  Or is _LOADIMAGE the only way to make a valid image handle to use.  I'm wondering if there is way via memory routines.

- Dav
Title: Re: Getting an image handle without _LOADIMAGE?
Post by: FellippeHeitor on September 13, 2018, 08:37:18 pm
_MEM routines are the way. In my programs (namely InForm) I dump the image from memory into a file on disk, pass it through Dav's BAS2BIN (thanks again!) and then, at run time, I unpack it into a string which I finally inject into a _NEWIMAGE using _MEM routines.
Title: Re: Getting an image handle without _LOADIMAGE?
Post by: Dav on September 13, 2018, 09:31:25 pm
Ah yes..I just checked out your LoadEditorImage& FUNCTION. That method looks like what I'm looking for.  Thanks, Fillippe!

- Dav