How to Include bitmaps/icons in an EXE?
Moderator: Rathinagiri
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
How to Include bitmaps/icons in an EXE?
Happy new year everyone,
The executable i'm producing doesn't display bitmaps/icons in the toolbar when i copy the executable into another folder or other computer. The bitmaps & icons i'm using are listed in the resources tab of the IDE, and show properly when I run from the project folder. My desire is to supply only one executable file.
I suspect i'm missing something, or is it that you have to supply the bitmaps/icon files together with the executable for it to work properly?
I'm using hmg3.
I would really appreciate some guidance please.
The executable i'm producing doesn't display bitmaps/icons in the toolbar when i copy the executable into another folder or other computer. The bitmaps & icons i'm using are listed in the resources tab of the IDE, and show properly when I run from the project folder. My desire is to supply only one executable file.
I suspect i'm missing something, or is it that you have to supply the bitmaps/icon files together with the executable for it to work properly?
I'm using hmg3.
I would really appreciate some guidance please.
Kind regards,
Gilbert.
Gilbert.
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: How to Include bitmaps/icons in an EXE?
Had you properly referenced with the reference name inside the control picture clause?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Czarny_Pijar
- Posts: 172
- Joined: Thu Mar 18, 2010 11:31 pm
- Location: 19.2341 E 50.2267 N
Re: How to Include bitmaps/icons in an EXE?
Looks like the easiest way to accomplish this task is to substitute the file c:\hmg35\RESOURCES\window.ico to another one of your choice.
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: How to Include bitmaps/icons in an EXE?
Thank you Rathi, cZarny,
I have made some further tests using samples\main.demo. Please compile it and copy the executable to another folder. When you run it from the ..\samples\main.demo folder, the printer and folder-open buttons show properly. When you run the executable in the other directory, the button images disappear. I hope this illustratrates my problem much better.
I have made some further tests using samples\main.demo. Please compile it and copy the executable to another folder. When you run it from the ..\samples\main.demo folder, the printer and folder-open buttons show properly. When you run the executable in the other directory, the button images disappear. I hope this illustratrates my problem much better.
Kind regards,
Gilbert.
Gilbert.
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: How to Include bitmaps/icons in an EXE?
That is because the resource definition of main.demo doesn't include any image except demo.ico, br_no, br_ok.
All other images are specified by their file names! For instance, line no. 531
All other images are specified by their file names! For instance, line no. 531
Code: Select all
PICTURE 'Demo.gif'East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: How to Include bitmaps/icons in an EXE?
Dear Rathi,
Thanks for your response and patience.
I have edited the main demo resource file from the IDE to read as follows;
I'm still getting the same result.
Thanks for your response and patience.
I have edited the main demo resource file from the IDE to read as follows;
Code: Select all
br_no BITMAP br_no.bmp
br_ok BITMAP br_ok.bmp
demo ICON demo.ico
open BITMAP open.bmp
print BITMAP button.bmp
Kind regards,
Gilbert.
Gilbert.
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: How to Include bitmaps/icons in an EXE?
Had you changed the reference in prg files too?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: How to Include bitmaps/icons in an EXE?
No Rathi, I haven't changed anything else...
Kind regards,
Gilbert.
Gilbert.
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: How to Include bitmaps/icons in an EXE?
That is the problem!
You have to specify the image reference only and not the filename in the .prg file.
Change #line 180 to
Like this, you have to refer the label given in resource file inside the prg file.
In your case, the exe file includes the resources, but since you refer the original filename, it searches for the file.
You have to specify the image reference only and not the filename in the .prg file.
Change #line 180 to
Code: Select all
PICTURE 'print'
In your case, the exe file includes the resources, but since you refer the original filename, it searches for the file.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: How to Include bitmaps/icons in an EXE?
Try to use uppercase letters. I think it should help you...
Marek
Marek