Icon Bitmap inside exe

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Yam.

How can I compile .ico or .bmp inside my exe.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Normally IncludeBinary is used...

Look also @:
viewtopic.php?t=2149
viewtopic.php?t=549


Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Hello Yam,

I guess you mean 'including' an image file in your executable file so that it is not necessary to place the image file itself aside the application.

PureBasic proposes IncludeBinary command to do so.

For example if you have an image file Image.bmp you would like to include in your executable, you can add such commands in your source code :

ImageID = CatchImage(1, ?MyImageFile)
ImageGadget(901, 0, 0, 600, 38, ImageID1)

; ... at the end of your source code

MyImageFile:
IncludeBinary "Image.bmp"

Such code means you include the binary content of the file when compiling inside the executable file, and the compiler will use this binary code as an array when load the image by CatchImage. Then you have just to use this catched image later in you app.

Hope this help.


Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Hey Franco, you won. Giving the link was quicker than typing my post !

KRgrds


Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Yam.

That`s it.Just what I was looking for.
thank you FWeil
:)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
Originally posted by fweil

Hey Franco, you won. Giving the link was quicker than typing my post !

KRgrds


Francois Weil
14, rue Douer
F64100 Bayonne
You don't know how long I searched for the links... :)

Have a nice day...

Franco
Post Reply