Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Converstion Icon to Bitmap

Posted on 1997-10-03
1
Medium Priority
?
246 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 20 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

609 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