从资源中加载图片到ImageList中,并透明
uses CommCtrls
procedure LoadImageList ( ImageList : TImageList ; ResName : string );
var
Bmp : TBitmap ;
begin
Bmp := TBitmap . Create ;
try
Bmp . LoadFromResourceName ( HInstance , ResName );
Bmp . TransparentMode := tmAuto ;
Bmp . Transparent := True ;
ImageList_AddMasked ( ImageList . Handle , Bmp . Handle , Bmp . TransparentColor );
finally
Bmp . Free ;
end ;
end ;