Solved

Converstion Icon to Bitmap

Posted on 1997-10-03
1
244 Views
Last Modified: 2010-04-04
How can I convert a Icon to a Bitmap in Delphi 2?

Points will be increased depending on the answer.

Regards Ian
0
Comment
Question by:e4monsch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
mirek071497 earned 10 total points
ID: 1346795
This is the easiest way :

var
  bmp : TBitmap;
  ico : TIcon;
  TmpDC : HDC;
begin
  ico := TIcon.Create;
  ico.LoadFromFile( 'd:\chip.ico' );
  bmp := TBitmap.Create;
  bmp.width := ico.width;
  bmp.Height := ico.Height;
  TmpDC := CreateCompatibleDC( 0 );
  DeleteObject( SelectObject( TmpDC, bmp.Handle ) );
  if DrawIcon( TmpDC, 0, 0, ico.handle ) then
    bmp.SaveToFile( 'd:\chip.bmp' )
  else
    ShowMessage ('I can''t convert' );
  DeleteDC( TmpDC );
  bmp.Free;
  ico.Free;
end;

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question