c0d3r 17 Posted August 21, 2020 (edited) 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 August 21, 2020 by c0d3r Share this post Link to post
aehimself 396 Posted August 21, 2020 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. 1 Share this post Link to post
FPiette 383 Posted August 21, 2020 BRCC32 cannot handle ico files with 24 bits RGB. Share this post Link to post
Arnaud Bouchez 407 Posted August 21, 2020 (edited) 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 August 21, 2020 by Arnaud Bouchez Share this post Link to post
Remy Lebeau 1397 Posted August 21, 2020 https://stefansundin.github.io/xn_resource_editor/ Share this post Link to post
c0d3r 17 Posted August 21, 2020 30 minutes ago, Remy Lebeau said: https://stefansundin.github.io/xn_resource_editor/ Thanks. It seems not supporting PNGs. I will have to convert PNGs to BMPs, then import them. Share this post Link to post
Anders Melander 1784 Posted August 21, 2020 https://www.google.com/search?q=free+resource+editor+res http://melander.dk/reseditor (I'm the author) 2 Share this post Link to post
c0d3r 17 Posted August 22, 2020 4 hours ago, Anders Melander said: https://www.google.com/search?q=free+resource+editor+res http://melander.dk/reseditor (I'm the author) WOW. Great work! Thank you very much. Share this post Link to post
Remy Lebeau 1397 Posted August 22, 2020 (edited) 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 August 22, 2020 by Remy Lebeau 2 Share this post Link to post
Anders Melander 1784 Posted August 22, 2020 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
FPiette 383 Posted August 22, 2020 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
Anders Melander 1784 Posted August 22, 2020 2 minutes ago, FPiette said: How to configure the IDE so that it calls RC.EXE instead of BRCC32.EXE? 1 1 Share this post Link to post
Fr0sT.Brutal 900 Posted August 24, 2020 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
Lars Fosdal 1792 Posted August 24, 2020 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
Anders Melander 1784 Posted August 24, 2020 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: 1 Share this post Link to post
Fr0sT.Brutal 900 Posted August 24, 2020 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