I've been asked to do a complicated job, I do not know if it can be done. A company had an application developed in Delphi (not that version) and asked me if I could change some images that appear inside the app.

With the "Resource Hacker" I could see something, but I do not know if that will be useful.

I give you an example:

object AboutBox1: TAboutBox1
  Left = 218
  Top = 74
  BorderStyle = bsDialog
  Caption = 'About...'
  ClientHeight = 510
  ClientWidth = 539
  Color = clActiveCaption
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  FormStyle = fsStayOnTop
  OldCreateOrder = True
  Position = poScreenCenter
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Image1: TImage
    Left = 193
    Top = 448
    Width = 153
    Height = 49
    Picture.Data = {
      0A544A504547496D616765EF0A0000FFD8FFE000104A46494600010100000100
      010000FFDB0043000C08090A09070C0A0A0A0D0D0C0E121E1312101012241A1B
      151E2B262D2C2A2629292F35443A2F32403329293B513C4046494C4D4C2E3954
      5A534A59444B4C49FFDB0043010D0D0D12101223131323493129314949494949
      4949494949494949494949494949494949494949494949494949494949494949
      49494949494949494949494949FFC0001108002D009603012200021101031101
      FFC4001F0000010501010101010100000000000000000102030405060708090A
      0BFFC400B5100002010303020403050504040000017D01020300041105122131
      410613516107227114328191A1082342B1C11552D1F02433627282090A161718
      191A25262728292A3435363738393A434445464748494A535455565758595A63
      6465666768696A737475767778797A838485868788898A92939495969798999A
      A2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6
      D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC4001F01000301
      01010101010101010000000000000102030405060708090A0BFFC400B5110002
      0102040403040705040400010277000102031104052131061241510761711322
      328108144291A1B1C109233352F0156272D10A162434E125F11718191A262728
      292A35363738393A434445464748494A535455565758595A636465666768696A
      737475767778797A82838485868788898A92939495969798999AA2A3A4A5A6A7
      A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE2E3
      E4E5E6E7E8E9EAF2F3F4F5F6F7F8F9FAFFDA000C03010002110311003F00C692
      EA71230121C6699F6BB8FF009EA6A3948F35B9EF4DC8F5AE63EA1463626FB5DC
      7FCF5347DAEE3FE7A9A8723D68C8F5A07CB126FB5DC7FCF535A08211A5D84EDF
      6A92E2EEE1E258D26C160085E063AE735919E382335AB3DF0B4B2B1834EBD398
      612B232A956DECC59B04F6E714E2FB9CF5E0E4D28916A0B7765797508924961B
      795A23385F9491FD718C81D33516ED473830DC025950029D59BEE8FA9ABDF69B
      47B08E26B90ACD6E96C8BB49F20120CB21F5624718CD49A96A163F676FB24CEE
      ED26514A91E5AAAED8F27D864F1DCD559194675745CBF8196935F4857CB49DF7
      B6D4213EF1E7A7E47F2A532EA0090D15C2E1773653EE8E793F91FC8D6B1D5618
      2E1A486E2331C51B3410A4640DC4045DC4F2CCABB8E7A67A554B7BB8974E8217
      B941BE422E0142CECACFF37CDD97600303934ACBB87B4AB6BF28C816E4D8DCDD
      DC09E34444F24B1DBB998F071DC6D04FE552E9F0CD79A65ECE905DDCDC452C71
      C690B9192DB89C803A703F3A4D4EEE096C422DC896792779662A8541ECA067B0
      03814C8A480E85158FF68081A4B869A7658D890368518C7520034D5AE2929B85
      DAD5BEC26A7E65A5ECD15B4F25C43132A19060E1C8FB99EE41C8FC2AA9B9B956
      2ACECAC3820F515AF25EC57777A8EA4AA63B38846912B9E64901040F73F2026B
      0598B31666C92724FAD4C8DA836D5A4B626FB5DC7FCF5347DAEE3FE7A9A8723D
      68C8F5A47472C49BED771FF3D4D1F6BB8FF9EA6A1C8F5A323D680E588F96E676
      500C8D4544FD28A68E6A9A4B43D8FF00B0F4BCFF00C812CFFEFDA7F85729A878
      8BC2FA75ECB6B73E1A29246C57FE3DE3C373D473D2BABD4DAE2DAC249ADB4F59
      244C1DAD2F18EFD3DABCE7E22DD2DDC9A74AB07947CB7046EDDCE477AD67751E
      647CD55ACE3B3D4D9D135AD0B51BDB947D02DD2103742C6D947E07AE7EB49A34
      F611C77D15F6936934C8C5A13F67550463EEF4E80D57B0D4AD2CB46B63291185
      8867CB4DEC6AA8F185A4824636D3BFCDB6289402CC31F798F41F866B6F723A3D
      CC3DB54BE8CE8B4697459F406D4351D2F4C8CC72323948940E0F1C75E6B3351D
      0EDADB508EE2D9ADE5B6BA265111453B14F231FECFA565DADED8EA504D05A5B9
      B69CF2E8FCFD48355358D7EDA4D45522867B28154094A0CB48C170B804F0BC74
      CF7A5CD08DA5DC4EB4A51B3DCDA9F4AB796452B1451A81CED8C7352269D66A82
      316F0EEC70590127F4A80EAF610E9715CCAF2B89388E251FBC73FD2AA1D4765E
      406F6CEE6CC4ADF234A72A7DBDAB47286C67CD3DEE68C7A75A45C35BC2DCFF00
      1229E7F2AA977A7DB5B06B868B7C6181D91440B75E8074A4D7354B2B42919732
      DC647C8321501EE4FF004152E87ACDA6A3A87D9A35954A722473F7947B76A5CF
      0BF2F50E69F7FC4CF9B59F0EE7CB7B0B9520E08585030FD6B7345D63C21BA2D3
      E5D29A290F0B25F44A4BE4F76FF22B93D31F4D8FC5B3BEA9FF001E8249370C36
      4F271F779ABDE26BBB3F126AB6565A24291A411F948D2B08F792780377A572FB
      46D6FA9B42A492BA67A69D1F4D68D50E8D6A517255762E067AE298DA2696AA4F
      F61D9F1FF4CD3FC2AB49343A0E8513EA236AC11AABCA5F3B8E3B0EE4D62CBE34
      8A0861BB9B43BA8EC663B56669065BDF6FA7E35A3696E753A96DD9BC343D3301
      9F45B5E7D11703F4A7FF0063692AC07F625A107A1F2D3FC2ABEA5AC5969BA4AE
      A5240CF04842C6AAFF0033B1E800AC87F11186E6D86A5A0DDD924AE162769720
      13D3228BA43752DD4E8BFB0F4BFF00A01D9FFDFB4FF0A4FEC4D33FE80567FF00
      7C27F8551D6B5CB2D1228FED304924F31C43044D977F7F6155A1F12C69796F6B
      AA68F71A73DD7FA9324B956F627B1E451742752DD4D7FEC4D33FE80569FF007E
      D3FC28AB621FFA7427FEDA514CAE66739AEDCEAD65A82A8B655B1986D52A72CA
      71CE4E6B8CF1D0655D3C3295F95F008F7157AF75ABA8FC4335B3B192232128A4
      FDC1D80FF1ACCD574F827BAF3A492E19E42492D2671F4E2AE7072872A3CE9CAF
      27735B4FD35BEC16EF82A3C9DC430E7A562F852D1AE04ECB81B4A8CE2B42DED7
      ECFA5C96C97375B65C12C25C103D07B547A5D825848CF14F71F3AB2901F1F8F0
      3AD37193927D89B22B69EA21F1A5D2740AEE39E292F6DE5BAF1CF910E3CC7650
      BB80233B47AF151FD8921D44CAB34E5F7E4B17E4F3DCE39AD2D4B4EB7D42E44E
      C658A4C60946EBFA547B2972AF5B826AE43E37B5B8B5D6F4FF003F112FD9D144
      D1E02B303F330C74EB4ABA3C77360F73A8DFCEF0C2C4873701948E9C67D6B7E2
      D234E9340874DBB8659FCBCB24DE6E1933D871D2AB59785746B69C4B3C33DC81
      C8479405FC7039A84ACDE97B9D0E8B6F430BC5460934FD2E5811C210E32FD5B1
      B6BA9B4D2AEE5D2ADB52D36CE12CE17722A8525471FD2A0B9F0EE8F72C0BC779
      B00C227DA72A83D06578ABB1D9DAC5A3B69B1B5EAAB367CDFB49DEBCF4071D2A
      936A4E5DC2341F5396F0D43E7FC43954DB09409A5263EC3935A5F136DEC2DE2B
      3115A476F74CE490A79298EFF8D4D0F85F4B81FCC8DEF924FEFA5C053FA2D3A2
      F0E68A973E75CC17576FD7F7B71D7EB81CD65C8F9794B54E5CBCA36692D1BC03
      6177E21B7B8976BFEE9524C198F38CFA0C679AC6F12CFA85DF87ED6E67B486C6
      C5A402D6DD3962BB4FCC49E48FCBAD74FACDBE997BA67D9DECA555420A6DB83F
      29E9C022AA45E1DD1C5A3432C37333326D577B8FF563FD918C0A72837A0E506F
      41B79631DE782AC2CA52B0DCC922242FE66479BB490AD8FBB915933C9E24F0F8
      87FB72DCDDD8F9A079770C1C1239F94F507038ADA4D0B461A57D83ECD70417DF
      E679FCEEF5C631517F655A2DE402FA4BEBE8A3E638E6B9F957F4A1C5BD41C1B7
      7EA65F8CDF778B6CEE6412DB5BC90C6518360A8E7383ED9ADBBAF0B696D0C573
      7DA9DC34431B1E4BD520E7D09F5AB9AC5BE97ACDAAC73D83214FB8E9372BFA56
      2E93E1ED1E0BC6927B79AE4467E5479405FC7028E57763E469BF33BD8A00B0A2
      A59B150A00266EB4564596A56F2DCCE3EC440046079C78FD28AD0D4FFFD9}
  end

I think that Picture.data is the image, but I don't know how to convert that string of letters. What can I do with this? How I can change that image?

Thanks!!

有帮助吗?

解决方案

  1. Create a new VCL forms application.
  2. Add a TImage component.
  3. Save the project.
  4. Paste the TImage property text from the question into the .dfm file.
  5. Run the application and check that it shows the expected image.
  6. Next, in the Delphi IDE load the new image into the image control.
  7. Paste the updated .dfm text into the form resource in your resource editor.

You may find that a different resource editor like XN Resource Editor is even able to understand Delphi TImage and let you modify the image directly.

其他提示

I will try to provide a walkthrough for those that may have no idea on how to to this or just want to get done with this as fast as possible.

This is how I changed the embedded images on the code, just as the OP showed on the question.

Note: The accepted answer that says that XN Resource Editor can understand Delphi TImage, this seems to be wrong or may not always work!


You will need the following free software:

You may also need image editors, there's free software options:


Finding out which image is to be replaced

If the program has many images, you can find out which is the correct image by following these steps:

  1. Make a backup copy of the original executable (.exe) file.
  2. Using a resource editor, open the original executable (.exe) file containing the image you want to replace.
  3. For every image you find under RCData, check the image size and other details, this can give you the correct image right away or at least reduce your scope. If you are looking for a huge image for example, you will just ignore small images.
  4. Remove all image data, just delete all that is between brackets under the Picture.Data property so it would look like Picture.Data = {} and compile the script with the Resource editor and save the exe with the changes.
  5. Execute the application, if the image you want to replace is missing during program execution, then you know that the image data you just removed is the image you want to replace.

You can also check which image is the correct by replace the image with another one, like a blank image, but then you would have to embed the image first into another Delphi program, and the copy and paste the image data from the new application into your own application, see bellow.


Changing the image

  1. Open the Lazarus IDE, as soon as it opens it should already present you with a new desktop application, including a form (Form1).
  2. Create a new TImage on the form (Form1) and then choose an image file by selecting the new TImage and on the Objects inspector window selecting the Picture property and then clicking on the three dots button [...]. After loading the image, it should appear on the form. The image size and other properties are not important.
  3. Save your Delphi application project with the new image somewhere and compile it.
  4. Using the resource editor, open both the original executable (.exe) file containing the image you want to replace, and the executable (.exe) you just compiled using Lazarus.
  5. Browse on the new compiled executable (RCData -> TFORM1) and you should locate the new image data under Picture.Data, copy everything between the brackets in Picture.Data and paste on the Picture.Data of the original executable.
  6. Now that the original executable, has the new image data, compile the script with the Resource editor and save the exe with the changes.
  7. Run the application and check if the image has been replaced successfully.

Note: Applications may only accept a specific image file format, if the image you used on Lazarus is a .png image and your original executable didn't show anything after replacing the TImage Picture.Data, then this may be the problem. You can try using a .bmp on Lazarus and then copying the .bmp Picture.Data to your original application.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top