Author Topic: wrapping .png files to the compiled .exe file  (Read 2060 times)

0 Members and 1 Guest are viewing this topic.

Offline Spambucket

  • Newbie
  • Posts: 5
    • View Profile
wrapping .png files to the compiled .exe file
« 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!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: wrapping .png files to the compiled .exe file
« Reply #1 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. 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.
Shuwatch!

Offline Spambucket

  • Newbie
  • Posts: 5
    • View Profile
Re: wrapping .png files to the compiled .exe file
« Reply #2 on: August 16, 2021, 02:59:25 pm »
Thsnk, will give that a try!