Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 673885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:38:42+00:00 2026-05-14T00:38:42+00:00

I am trying to make icon extractor i am successful in getting icon to

  • 0

I am trying to make icon extractor

i am successful in getting icon to image1.picture.icon ,its looking same as orginal file icon,
but when i am trying to save (iamge1.picture.icon.savetofile(c:\imahe.ico))

its not saving as it is ,it saving with less colur and looking ugly

cany any one please tell me what i am doing wrong ?

here is my code

procedure TForm1.Button1Click(Sender: TObject); 
begin 
 OpenDialog1.Filter:='All files |*.*'; 
 OpenDialog1.Title:='Please select file'; 
 if OpenDialog1.Execute then 
 Edit1.Text:=OpenDialog1.FileName; 
end;

procedure TForm1.Button3Click(Sender: TObject); 
var   
szFileName: string;   
Icon:       TIcon;   
SHInfo: TSHFileInfo; 
begin

  szFileName := Edit1.Text;
  if FileExists(Edit1.Text) then   
  begin
      Icon := TIcon.Create;
      SHGetFileInfo(PChar(szFileName), 0, SHInfo, SizeOf(SHInfo), SHGFI_ICON);
      Icon.Handle := SHInfo.hIcon;
      Image1.Picture.Icon := Icon;
      end;  
end;

procedure TForm1.Button2Click(Sender: TObject);  
begin  
  if SaveDialog1.Execute then  
   begin   
   Image1.Picture.Icon.SaveToFile(SaveDialog1.FileName+'.ico'); 
   ShowMessage('done');  
   end;  
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:38:43+00:00Added an answer on May 14, 2026 at 12:38 am

    the SHGetFileInfo function has multiples flags to obtain different icons sizes.

    const
      SHIL_LARGE     = $00;  //The image size is normally 32x32 pixels. However, if the Use large icons option is selected from the Effects section of the Appearance tab in Display Properties, the image is 48x48 pixels.
      SHIL_SMALL     = $01;  //These images are the Shell standard small icon size of 16x16, but the size can be customized by the user.
      SHIL_EXTRALARGE= $02;  //These images are the Shell standard extra-large icon size. This is typically 48x48, but the size can be customized by the user.
      SHIL_SYSSMALL  = $03;  //These images are the size specified by GetSystemMetrics called with SM_CXSMICON and GetSystemMetrics called with SM_CYSMICON.
      SHIL_JUMBO     = $04;  //Windows Vista and later. The image is normally 256x256 pixels.
    

    you can use this flags in this way

    SHGetFileInfo(PChar(szFileName), 0, SHInfo, SizeOf(SHInfo), SHGFI_ICON OR  SHIL_LARGE );
    

    for more info you can check the answer to this question.

    Can 48×48 or 64×64 icons be obtained from the Vista Shell

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to make an icon that has transparency. I've tried Axialis but
I am trying to make a gridview with large icon for an app but
Trying to make a small countdown timer in my app but it's not working.
I am trying to make a tabview in android that has icon alongwith background.
I have been trying to make a updateable grid.Which means i show an icon
Hey I am trying to make a notification for my file uploading notification. This
I'm trying to make a java application on Mac that puts an icon in
I am trying to make a help screen that pulls up an html file
I'm trying to make a fancy blinking icon and animate the brush of a
I'm trying to make my top action bar icon to allow users to go

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.