Inside Man
Inside Man

Reputation: 4297

Set Background Image for a Form in Delphi

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 :)

Upvotes: 3

Views: 4542

Answers (3)

Premature Optimization
Premature Optimization

Reputation: 1938

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.

Upvotes: 0

LU RD
LU RD

Reputation: 34899

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

Upvotes: 1

Rob Kennedy
Rob Kennedy

Reputation: 163287

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:

Upvotes: 2

Related Questions