3

I have an old app (Delphi 5) which I want to give it some changes via Res Editor !

I want to set a background image for a Form via RCData in Res Editor, How can I do that?

Any help is really appreciated. Thanks :)

Inside Man
  • 4,194
  • 12
  • 59
  • 119

3 Answers3

2

Delphi forms don't have a simple background-image property.

You could edit the DFM resource for the form to insert a TImage control. Extract the DFM resource, open it in Delphi, add the control you want, save it, and then replace the original resource with your new version.

See also:

Community
  • 1
  • 1
Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
  • You mentioned a resource editor. Use that. Exactly *how* depends on which resource editor you have. – Rob Kennedy Jun 09 '11 at 05:56
  • I have Restorator and PE Explorer which can show you RCData, But extracting them in DFM form is what I don't know how to do that. So How to do that? – Inside Man Jun 09 '11 at 06:05
  • 1
    Don't those programs have some way to save a resource to a file? Or at least a way to copy and paste? As a last resort, you could write a quick program that creates a `TResourceStream` and then calls its `SaveToFile` method. – Rob Kennedy Jun 09 '11 at 06:23
  • @Rob I have extracted those Forms in .dfm format. Now can you introduce me a DFM Form Editor? – Inside Man Jun 09 '11 at 06:32
  • 2
    *Delphi* is your DFM editor. Try this: Start a new project, save it, and close it. Replace that project's *Form1.dfm* with your resource, and then re-open the project. – Rob Kennedy Jun 09 '11 at 06:37
1

Angus Johnson has written a utility called ResHacker. Use it to directly edit the form properties in the exe file. This is the link to his site

LU RD
  • 34,438
  • 5
  • 88
  • 296
0

Majid Pasha, procedure is really simple and straight-forward:

  1. Extract form resource (type is RCDATA, name matches form in question, language is not important)
  2. Convert form from binary format to text using convert utility (shipped with delphi)
  3. Use your Delphi to design boilerplate image, load picture, set placement, etc
  4. View designed form as text, copy you new image definition along with all its data
  5. Paste image into text version of extracted form resource
  6. convert back to binary format
  7. Add resource back to executable replacing original one.

Note: depending on tools uses, there might be some shortcuts to bypass conversions and extraction, eg: XN Resource Editor is able to edit Text DFM directly.

Premature Optimization
  • 1,917
  • 1
  • 15
  • 24