QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Spambucket on August 16, 2021, 02:27:44 pm

Title: wrapping .png files to the compiled .exe file
Post by: Spambucket on August 16, 2021, 02:27:44 pm
Sorry if this has been hashed through before:

I have a single .bas file that compiles OK. Is there a way to "include" several .png files into this .exe file so the single compiled .exe program does not have to access the HD to load the .png files?

Thanks!
Title: Re: wrapping .png files to the compiled .exe file
Post by: SpriggsySpriggs on August 16, 2021, 02:35:03 pm
Yes. What you're looking for is BASIMAGE by Dav or my implementation here: https://github.com/SpriggsySpriggs/BIN2INCLUDE (https://github.com/SpriggsySpriggs/BIN2INCLUDE). The only thing you must take into account, though, is the size of each individual PNG. If the source is too large then QB64 will fail to compile due to being out of memory. The routine that Dav and I use does compress the image first but it can only compress so much, especially since PNGs are already compressed. It might take some fiddling. Make sure you use the PIC2MEM option. You will include the output file in your source and you will call the created function in order to use the image. Let me know if you have questions and/or issues.
Title: Re: wrapping .png files to the compiled .exe file
Post by: Spambucket on August 16, 2021, 02:59:25 pm
Thsnk, will give that a try!