Jump to content
c0d3r

Free Resource Builder Utility?

Recommended Posts

Does anyone know there is a good free Resource Builder utility that I can use to create .res file by importing bitmap, png, jpg, strings, ..., etc.  Thanks.

Edited by c0d3r

Share this post


Link to post

BRCC32? 🙂

Seriously, though. I have a batch script which crawls through a directory structure and creates a .RC file based on what it finds. As a final step it launches BRCC32 thisfile.rc and deletes the unnecessary .RC file.

Works like a charm.

  • Like 1

Share this post


Link to post
49 minutes ago, FPiette said:

BRCC32 cannot handle ico files with 24 bits RGB.

I don't see why - but I never used 24bits RGB icons... 16bits are good enough...

Edited by Arnaud Bouchez

Share this post


Link to post
5 hours ago, c0d3r said:

Thanks.  It seems not supporting PNGs. I will have to convert PNGs to BMPs,  then import them.

Or, you could just treat them as-is as RCDATA resources instead.  Any data can be stored in RCDATA, it is just raw bytes.  Now, whether you can load a PNG image from an RCDATA resource at runtime is another issue, depending on HOW you load it.

Edited by Remy Lebeau
  • Like 2

Share this post


Link to post
15 hours ago, FPiette said:

BRCC32 cannot handle ico files with 24 bits RGB.

AFAIR brcc32 can handle both 24- and 32-bit icons. It is PNG-compressed icons it has problems with.

Just use the Microsoft resource compiler instead (rc.exe). It's part of the SDK but can also be found in Delphi\Bin.

 

8 hours ago, Remy Lebeau said:

Now, whether you can load a PNG image from an RCDATA resource at runtime is another issue, depending on HOW you load it. 

var
  PNG: TPngImage;
  Stream: TStream;
begin
  PNG := TPngImage.Create;
  try
    // Load a resource named 'MyImage' from a RCDATA resource
    Stream := TResourceStream.Create(hInstance, 'MyImage', RT_RCDATA);
    try
      PNG.LoadFromStream(Stream);
    finally
      Stream.Free;
    end;

    ...

  finally
    PNG.Free;
  end;
end;

 

Since we can call the resource types anything we want I usually use just name it 'PNG' for PNG images.

Stream := TResourceStream.Create(hInstance, 'MyImage', 'PNG');

 

Share this post


Link to post
2 hours ago, Anders Melander said:

It is PNG-compressed icons it has problems with.

Just use the Microsoft resource compiler instead (rc.exe). It's part of the SDK but can also be found in Delphi\Bin.

OK, it should work. How to configure the IDE so that it calls RC.EXE instead of BRCC32.EXE?

 

Share this post


Link to post

I use "Resource editor 2.2.0.6c KetilO © 2010" just for dialog resources because this app has very convenient feature of generating an include file for all cnotrol IDs in the dialog so I just $I it in my code

 

Share this post


Link to post
On 8/22/2020 at 1:02 PM, Anders Melander said:

Just use the Microsoft resource compiler instead (rc.exe). It's part of the SDK but can also be found in Delphi\Bin.

Are there any BRCC32 specialties that doesn't work with the MS RC compiler?
 

Share this post


Link to post
6 minutes ago, Lars Fosdal said:

Are there any BRCC32 specialties that doesn't work with the MS RC compiler?

Yes I believe there are slight differences in the syntax but I simply can't remember them anymore. BRCC32 used to be a superset of RC back when Borland was a leader in development tools... So quite some time ago.

If I could find some documentation of BRCC32 I could probably tell you what they are.

 

See also:

 

  • Thanks 1

Share this post


Link to post

I use MS compiler with no issues because it supports UTF8. At least XE2's brcc doesn't. And it supports more control styles and properties.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×