On 30.06.2022 16:54, Werner Pamler via lazarus wrote:
Am 30.06.2022 um 15:11 schrieb Mattias Gaertner via lazarus:
Maybe instead of the GraphicClass.ClassName the first extension can be
written.
That means, that an old IDE cannot read the graphic.
This will break Delphi compatibility, i.e. forms with an image in which the Picture has been loaded by Delphi will not be readable by Lazarus any more, and vice versa. Just checked again the signature that Delphi writes to the begin of the Picture.Data: it's the class name, not the extension.

And what about writing the extension to the data end?

    Picture.Data = {
      0B 54 49 6D 61 67 69 6E 67 50 4E 47 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 00 00 01 C6       11 T  I  m  a  g  i  n  g  P  N  G                // 11 is the length byte
      03 p  n  g

That should be both Delphi and legacy Lazarus compatible if the reader reads only the defined count of bytes for the classname?

Newer Lazarus versions would first search the extension and if not found they search for the classname.

Ondrej

-- 
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to