Board index » delphi » Putting anything into a resource file

Putting anything into a resource file

Is there a tutorial anywhere that will show me how to create an rc and rh
file to include resources in my code.  I don't want to use a program to do
it as i aim to include 24 bit bitmaps.

I found one for C builder but i couldnt persuade it to work.

Cheers
Spanner

 

Re:Putting anything into a resource file


Quote
"Spanner" <ben.langri...@btinternet.com> wrote in message

news:8892sr$lk5$1@uranium.btinternet.com...
Quote
> Is there a tutorial anywhere that will show me how to create an rc and rh
> file to include resources in my code.  I don't want to use a program to do
> it as i aim to include 24 bit bitmaps.

> I found one for C builder but i couldnt persuade it to work.

> Cheers
> Spanner

Assuming you have the files containing the bitmaps you want:

Step 1
Using NotePad or another text editor create a new file.
For each bitmap, In that file enter a line containing the following
information:

BitmapName BITMAP Path and filename of bitmap

For example:

HEART_KING BITMAP C:\Cards\HeartKing.bmp

Save the file with the extension "rc".

For example: "MyCards.rc"

Step 2
Compile the "beep.rc" file to a RES file using the resource compiler
brcc32.exe. This is located in the Delphi\bin folder. Where that is depends
on your version of delphi. On my machine it is located in c:\program
files\borland\delphi5\bin.

Brcc32.exe is a DOS program so open a DOS window.

Go to the directory containing the MyCards.rc file.

Type:
c:\program files\borland\delphi5\bin\brcc32 MyCards.rc

Note: Substitute the proper path for your system.

The file "MyCards.res" should be created in the directory where "MyCards.rc"
is
located.

Step 3
Include the res file in your program with the line
{$R MyCards.res}

Other Threads