Theo
Theo

Reputation: 464

Delphi : How to read image from ".res file", not the embedded resource

Does anyone know how to read an image from .res file on disk, using a Delphi program?

Please note that i'm asking about reading an image from .res file on disk, and not about embedding resources to Delphi Application and read a resource file linked into an executable.

I mean :

  1. Filename and path to a .res file on disk, open the .res file and decode it enough to...
  2. Locate the Image.
  3. Load the image

not something like this :

{$R resfile.res}    

blablabla.LoadFromResourceName(HInstance, 'IMAGE_NAME');

Thank you for advanced help.

Upvotes: 3

Views: 2927

Answers (1)

LaKraven
LaKraven

Reputation: 5869

The open-source XN Resource Editor (written in Delphi) contains the necessary code to do this (as well as read/edit resources from executables, DLLs, OCX modules etc). You'll be able to pull what you need from that!

Upvotes: 5

Related Questions