Ok, it looks like no bug to Delphi 2010, 2009…
If you use AddIcon the Icon will be added, but no item will be added.
If manually add icon also a item will be added.
dirty workaround:
CODE
Function AddTIcon(var ImageList : TsAlphaImageList; const Icon : TIcon): Integer;
var
TempStream : TMemoryStream;
NewItem : TsImgListItem;
begin
TempStream := TMemoryStream.Create;
Result := -1;
try
Icon.SaveToStream(TempStream);
NewItem := TsImgListItem.Create(ImageList.Items);
NewItem.ImgData.SetSize(TempStream.Size);
CopyMemory(NewItem.ImgData.Memory,TempStream.Memory,TempStream.Size);
Result := ImageList.AddIcon(Icon);
finally
TempStream.Free;
end;
end;