TImageEnMView.ImageUserPointer
Declaration
property ImageUserPointer[Index: Integer]: Pointer;
Description
Associates a Pointer with the image at
Index.
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 TForm1.AddImageToGrid(const FileName, Description: string; iRecordID: Integer);
var
POurRecord: ^TFileDataRecord;
iNewIndex: Integer;
begin
// Allocate memory
GetMem(POurRecord, SizeOf(TFileDataRecord));
iNewIndex := ImageEnMView1.AppendImage( FileName );
POurRecord.Description := Description;
POurRecord.RecordID := iRecordID;
ImageEnMView1.ImageUserPointer[iNewIndex] := POurRecord;
end;
// When removing items from the ImageEnMView1 deallocate the memory...
Procedure TForm1.ClearGrid;
begin
for i := 0 to ImageEnMView1.ImageCount - 1 do
FreeMem(ImageEnMView1.ImageUserPointer[i]);
ImageEnMView1.Clear();
end;