1. Home
  2. Computing & Technology
  3. Delphi Programming

How to convert an ICO to a BMP

By , About.com Guide

If you have an icon file (ICO) and want to convert it to a bitmap image, use the following code:

~~~~~~~~~~
Procedure IcoToBmp;
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;
~~~~~~~~~~

Delphi tips navigator:
» Prevent CTRL+DELETE in DBGrid
« Life Cyyle of a Form

Explore Delphi Programming
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 1999 Delphi Tips
  7. How to convert an ICO to a BMP

©2010 About.com, a part of The New York Times Company.

All rights reserved.