Page 1 of 1
Including images into exe
Posted: Sun Nov 16, 2003 8:28 pm
by Codemonger
Ok I would like to include binary images into the exe, that is not a problem.
The question is are the purebasic commands for including binary files compatible with windows resource commands ? are the same or similar ?
I haven't searched the forum yet on this particular topic, so I'll do that in the meantime. Anyway just want to know If I could load a resource from a file using purebasics include binary commands.
Posted: Sun Nov 16, 2003 9:29 pm
by GPI
Only with additional Tools, like ResHacker (see jaPBe). But when you use ResHacker, than you must (!) add a icon to the exe, or you get only corrupted Exes.
Posted: Sun Nov 16, 2003 11:05 pm
by Codemonger
Thanks GPI, I didn't even know the source of your editor is available .. what license do you have if I wan't to use your source codeto JaPBe, or modify it ?
Posted: Mon Nov 17, 2003 9:40 am
by Seldon
Include-Binary commands don't work for Windows resources. Actually resources are a better way to include files as the memory is used since you load them and they can be freed when if you don't need them anymore.
But as GPI said you can add a compiled resource using ResHacker. To access a resource you must use the Win-API, but it's very easy (I posted some code in Tricks 'n' Tips section). Actually I hope Fred will support the option to add a .RES file to your EXEs by the PBCompilter (it can be done very quickly). The way I'd suggest is this:
1) You put your own .RES in the same directory with the same name of your PB source, ex:
MySource.pb -> MySource.RES
2)PBCompilter will look if there is a .RES file with the same name of the source. Does it exist ?
If yes:
- forget the icon option (as the linker can't accept 2 .RES file)
- pass it to linker to build the final EXE
if no:
- user wants the icon ? ok, add it
- like before...
If you want the icon and your own .RES, you have just to include the icon in your .RES (you must only pay attention and give it the same number PB uses to load it in the window border).
Good idea
Posted: Mon Nov 17, 2003 10:38 am
by thefool
I think your ide, seldon is very good!
Or else a possibility would be to have an tag like
;addresfile: test.res
or something like that
Posted: Mon Nov 17, 2003 2:57 pm
by Codemonger
Thanks guys, your ideas are very much appreciated. And it looks like it will work for what I want it for.
Posted: Mon Nov 17, 2003 6:27 pm
by GPI
Codemonger wrote:Thanks GPI, I didn't even know the source of your editor is available .. what license do you have if I wan't to use your source codeto JaPBe, or modify it ?
What exact do you want: Create your own mutant of japbe? When you don't give this version to others: No problems.
When you want to translate jaPBe for other languages (I know, that somebody change jaPBe so, that it works with DarkBasic). Also no problem, BUT i want to know this and i want to see a preview-version before i give my ok.