Recent

Author Topic: [SOLVED] PNG image format in LFM  (Read 330 times)

Dmitriy

  • Newbie
  • Posts: 3
[SOLVED] PNG image format in LFM
« on: August 11, 2020, 03:43:24 pm »
Have a nice day!
Where can I read the description of Picture.Data format in LFM-file?
For example, for PNG image.

LCLVersion = '2.0.8.0'
object Image1: TImage
Picture.Data = {1754506F727461.......}

Best regards, Dmitriy.
« Last Edit: August 20, 2020, 08:49:41 pm by Dmitriy »

Handoko

  • Hero Member
  • *****
  • Posts: 3752
  • My goal: build my own game engine using Lazarus
Re: PNG image format in LFM
« Reply #1 on: August 11, 2020, 03:57:49 pm »
Hello Dmitriy,
Welcome to the forum.

Why do you need to read it directly from the .LFM file?

If you really need to do it, you should load it into memory and you can get the data. It is a bit hard, but you can learn it here:
https://forum.lazarus.freepascal.org/index.php/topic,48612.0.html

lucamar

  • Hero Member
  • *****
  • Posts: 3017
Re: PNG image format in LFM
« Reply #2 on: August 11, 2020, 04:31:54 pm »
You might also look to the code for TPicture or TPNGImage (or however it's called) to see how they implement it.

Or somewhere in the source of Lazarus itself, dauntig as the task may seem. ;)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8715
  • FPC developer.
Re: PNG image format in LFM
« Reply #3 on: August 11, 2020, 04:44:33 pm »
It's probably just the image uuencoded and prefixed by some record that lists e.g. coordinates and maybe format).

Dmitriy

  • Newbie
  • Posts: 3
Re: PNG image format in LFM
« Reply #4 on: August 19, 2020, 06:01:40 pm »
Hello Dmitriy,
Welcome to the forum.

Why do you need to read it directly from the .LFM file?

If you really need to do it, you should load it into memory and you can get the data. It is a bit hard, but you can learn it here:
https://forum.lazarus.freepascal.org/index.php/topic,48612.0.html

I'm making small Lazarus online for school.
Thank you for the link! I've found interesting information there.

Dmitriy

  • Newbie
  • Posts: 3
Re: PNG image format in LFM
« Reply #5 on: August 19, 2020, 08:28:22 pm »
Thanks for all!
The topic can be closed, but I don't know how to do this...

dsiders

  • Sr. Member
  • ****
  • Posts: 370
Re: PNG image format in LFM
« Reply #6 on: August 19, 2020, 08:32:25 pm »
Thanks for all!
The topic can be closed, but I don't know how to do this...

Edit the subject line in the first post to include '[SOLVED]' at the beginning.
Lazarus 2.1 (SVN) / FPC 3.0.4 / FPC 3.2.0 / x86-win64 / Windows 8.1

 

TinyPortal © 2005-2018