开发者

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:

  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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜