Page 1 of 1

Embed image in a DataSection [SOLVED]

Posted: Fri Sep 30, 2022 11:49 am
by daveb
I have been struggling to find a way to encode an image to embed it in a DataSection like this:

Code: Select all

DataSection
  Image_start:
    Data.q $0A1A0A0D474E5089,$524448490D000000,$2400000024000000,$9800E10000000608,$4752730100000098
    Data.q $0000E91CCEAE0042,$0000414D41670400,$00000561FC0B8FB1,$0000735948700900,$C701C30E0000C30E
    Data.q $494307000064A86F,$6D96ED4758544144,$DCF3CFC71567548C,$3BB6F3B9DEE77BF7,$D0897128A5D0EFB0
    Data.q $5356D0D0AC1696B2,$312F8D687E8C496D,$A4D536B49B56C486,$BF135A86B131B589,$2D2D144D6B46C1F8
    Data.q $80974B29A143428A,$B17616AE94AE9BAC,$E67733B0ECECCEFB,$71B201D8678F3FBE,$9326FEE0FC1FA8A1
    ........
  Image_end:
EndDataSection
I found a forum post dating back to August 2008 asking the same question: http://forums.purebasic.com/english/vie ... 47#p257175
Unfortunately, I cannot get any of the proposed solutions to work for me.
Any pointers or recommendations of other mechanisms or software to produce this encoded data would be much appreciated

TIA
Dave

Re: Embed image in a DataSection

Posted: Fri Sep 30, 2022 12:08 pm
by Little John
I would do it lke this:

Code: Select all

DataSection
   ImageStart:
   IncludeBinary "MyImage.png"
   ImageEnd:
EndDataSection 

Re: Embed image in a DataSection [Solved]

Posted: Fri Sep 30, 2022 12:31 pm
by daveb
Thanks Little John,
Nice clean simple solution.
Regards Dave