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 :)
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:
- Setting up background images for forms in Delphi
- How to add background images to Delphi forms
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
Majid Pasha, procedure is really simple and straight-forward:
- Extract form resource (type is RCDATA, name matches form in question, language is not important)
- Convert form from binary format to text using
convert
utility (shipped with delphi) - Use your Delphi to design boilerplate image, load picture, set placement, etc
- View designed form as text, copy you new image definition along with all its data
- Paste image into text version of extracted form resource
convert
back to binary format- 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.
精彩评论