[fpc-pascal] Bitmap-as-const-and-write-to-file-thingy

Bo Berglund bo.berglund at gmail.com
Thu Sep 20 23:45:31 CEST 2018


On Wed, 19 Sep 2018 23:58:36 +0200, Marc Santhoff
<M.Santhoff at web.de> wrote:

>Any pointers or hints, please?

You can convert any file you like to an inc file with pascal syntax:

data2inc -A -B laz/images/ide_icon48x48.png datatest.inc icon48x48

This will produce a datatest.inc file ready to be included in your
project and with content looking like this:

const icon48x48 : array[0..4236] of byte=(
  $89,$50,$4E,$47,$0D,$0A,$1A,$0A,$00,$00,$00,$0D,$49,$48,$44,
....
 $45,$4E,$44,$AE,$42,$60,$82);

data2inc is installed with fpc/lazarus ready for use.
I used a png file shipped with lazarus as the example above.


-- 
Bo Berglund
Developer in Sweden




More information about the fpc-pascal mailing list