Solved

Converstion Icon to Bitmap

Posted on 1997-10-03
1
234 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can't connect to Outlook via TOutlookApplication component 15 118
Best Firemonkey component pack 1 85
Run video youtube webbrowse 10 57
QRReport  TQrmemo vertical stretching 1 42
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now