Hi team,
I don't know to much about this but I am having problem
with this code. I want to convert a PNG file to ico
and save it to ico file. Please help me solve this.
Many thanks team.
var
vIcon: TIcon;
vPNG: TPortableNetworkGraphic;
begin
vPNG := TPortableNetworkGraphic.Create;
vIcon := TIcon.Create;
try
vPNG.LoadFromFile('C:\Users\UserName\Desktop\information.png');
vIcon.Assign(vPNG);
vIcon.SaveToFile('C:\Users\UserName\Desktop\myIcon.ico');
finally
vPNG.Free;
vIcon.Free;
end;
end;
Error:
Cannot assign a TPortableNetworkGraphic to a TIcon.