Author Topic: Getting an image handle without _LOADIMAGE?  (Read 2880 times)

0 Members and 1 Guest are viewing this topic.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Getting an image handle without _LOADIMAGE?
« 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

FellippeHeitor

  • Guest
Re: Getting an image handle without _LOADIMAGE?
« Reply #1 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.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Getting an image handle without _LOADIMAGE?
« Reply #2 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