kleiner Tipp, wenn Du Dir das Casten sparen willst:
eine TImage-Objectliste
Delphi-Quellcode:
interface
type
TImageObjectList = class(TObjectList)
protected
function GetItem(Index: Integer): TImage;
procedure SetItem(Index: Integer; AItem: TImage);
public
function Add(AItem: TImage): Integer;
function Extract(Item: TImage): TImage;
function Remove(AItem: TImage): Integer;
function IndexOf(AItem: TImage): Integer;
procedure Insert(Index: Integer; AItem: TImage);
function First: TImage;
function Last: TImage;
property Items[Index: Integer]: TImage read GetItem write SetItem; default;
end;
implementation
{ TImageObjectList }
function TImageObjectList.Add(AItem: TImage): Integer;
begin Result := inherited Add(AItem); end;
function TImageObjectList.Extract(Item: TImage): TImage;
begin Result := TImage(inherited Extract(Item)); end;
function TImageObjectList.First: TImage;
begin Result := TImage(inherited First); end;
function TImageObjectList.GetItem(Index: Integer): TImage;
begin Result := TImage(inherited Items[Index]); end;
function TImageObjectList.IndexOf(AItem: TImage): Integer;
begin Result := inherited IndexOf(AItem); end;
procedure TImageObjectList.Insert(Index: Integer; AItem: TImage);
begin inherited Insert(Index, AItem); end;
function TImageObjectList.Last: TImage;
begin Result := TImage(inherited Last); end;
procedure TImageObjectList.SetItem(Index: Integer; AItem: TImage);
begin inherited Items[Index] := AItem; end;
function TImageObjectList.Remove(AItem: TImage): Integer;
begin Result := inherited Remove(AItem);end;