ImageEn, unit iemview

TImageEnMView.ImageUserPointer

TImageEnMView.ImageUserPointer


Declaration

property ImageUserPointer[idx: Integer]: pointer;


Description

Associates a pointer with image, idx.

Note:
 This property is not used by TImageEnMView in any way and is provided for custom use.
 The value is not loaded/saved from file and streams, or copied/pasted to clipboard.


Example

// Store a description and record ID when adding files to our grid
type
  TFileDataRecord = Record
    Description : string[100];
    RecordID : Byte;
  end;

Procedure TfMain.AddImageToGrid(const sFilename, sDescription : string; iRecordID : Integer);
var
  POurRecord : ^TFileDataRecord;
  iNewIndex: Integer;
begin
  // Allocate memory
  GetMem(POurRecord, SizeOf(TFileDataRecord));

  iNewIndex := ImageEnMView1.AppendImage(sFilename);
  POurRecord.Description := sDescription;
  POurRecord.RecordID := iRecordID;

  ImageEnMView1.ImageUserPointer[iNewIndex] := POurRecord;
end;

// When removing items from the ImageEnMView1 deallocate the memory...
Procedure TfMain.ClearGrid;
begin
  for i := 0 to ImageEnMView1.ImageCount - 1 do
    FreeMem(ImageEnMView1.ImageUserPointer[i]);
  ImageEnMView1.Clear;
end;