Nu har jeg aldrig kodet så meget Delphi, men fandt denne kode:
var
Icon : TIcon;
Bitmap : TBitmap;
begin
Icon := TIcon.Create;
Bitmap := TBitmap.Create;
Icon.LoadFromFile('c:\\picture.ico') ;
Bitmap.Width := Icon.Width;
Bitmap.Height := Icon.Height;
Bitmap.Canvas.Draw(0, 0, Icon ) ;
Bitmap.SaveToFile('c:\\picture.bmp') ;
Icon.Free;
Bitmap.Free;
end;
Tror at den kan laves om til:
var
Icon : TIcon;
Bitmap : TBitmap;
begin
Icon := TIcon.Create;
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile('c:\\picture.bmp') ;
Icon.Width := Bitmap.Width;
Icon.Height := Bitmap.Height;
Icon.Canvas.Draw(0, 0, Bitmap ) ;
Icon.SaveToFile('c:\\picture.ico') ;
Icon.Free;
Bitmap.Free;
end;