Y
yunxi126
Unregistered / Unconfirmed
GUEST, unregistred user!
var
Bmp: TBitmap;
Icon: TIcon;
ImageList: TImageList;
begin
Bmp := TBitmap.Create;
Icon := TIcon.Create;
try
Bmp.Assign(Image1.Picture);
ImageList := TImageList.CreateSize(Bmp.Width, Bmp.Height);
try
ImageList.AddMasked(Bmp, Bmp.TransparentColor);
ImageList.GetIcon(0, Icon);
Icon.SaveToFile('c:/123.ico');
finally
ImageList.Free;
end;
finally
Bmp.Free;
Icon.Free;
end;
掉色严重
Bmp: TBitmap;
Icon: TIcon;
ImageList: TImageList;
begin
Bmp := TBitmap.Create;
Icon := TIcon.Create;
try
Bmp.Assign(Image1.Picture);
ImageList := TImageList.CreateSize(Bmp.Width, Bmp.Height);
try
ImageList.AddMasked(Bmp, Bmp.TransparentColor);
ImageList.GetIcon(0, Icon);
Icon.SaveToFile('c:/123.ico');
finally
ImageList.Free;
end;
finally
Bmp.Free;
Icon.Free;
end;
掉色严重