ImageEn, unit iexLayers

TIELayer.UserDataLen

TIELayer.UserDataLen


Declaration

property UserDataLen: Integer;


Description

Specifies the size of the data stored in the UserData buffer.

If this value is greater than zero:
When you save the layer (LayersSaveTo..) the content of the UserData buffer is saved (and restored with LayersLoadFrom..)
The user data is freed when the layer is destroyed

If you leave UserDataLen=0, you are responsible for freeing the memory you have assigned to UserData yourself!


Demo

Demo  Demos\LayerEditing\UserDataInLayer\UserDataInLayer.dpr


Example

type
  TMyRecord = record
    SourceText: array[0..255] of AnsiChar;
    SourceWidth: integer;
    SourceHeight: integer;
  end;
  PMyRecord = ^TMyRecord;

var
  rc: PMyRecord;
begin
  New( rc )
  With rc^ do
  begin
    Width := ...;
    Height := ...;
    Text := ...;
  end;
  ImageEnView1.CurrentLayer.UserData := rc;
  ImageEnView1.CurrentLayer.UserDataLen := SizeOf( PMyRecord );
end;


See Also

UserData