Tips (1541)
procedure TForm1.Button1Click(Sender: TObject); var Icon: TIcon; Bitmap: TBitmap; begin {Create a temporay icon} Icon := TIcon.Create; try {Create a temporay bitmap} Bitmap := TBitmap.Create; try {Load the .ICO} Icon.LoadFromFile('c:\YourIcon.ico'); {Make the conversion} Bitmap.Height := Icon.Height; Bitmap.Width := Icon.Width; Bitmap.Canvas.Draw(0, 0, Icon); {Save the BMP} Bitmap.SaveToFile('c:\YourBitmap.bmp'); finally Bitmap.Free; end; finally Icon.Free; end; end;
Rate this tip: