[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Convert bitmap or icon to Glyph

Posted on 2003-11-10
3
Medium Priority
?
1,178 Views
Last Modified: 2013-12-02
Hello experts!
   Please tell me about  format of Glyph file.And how to convert  a file bitmap or icon to Glyph.

Thanks.
0
Comment
Question by:z27
[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
3 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9720477
a glyph is already an ordinary bitmap

to convert an icon to a bitmap,
just could use the stretchdraw mthod of a bitmap.canvas

meikl ;-)
0
 

Author Comment

by:z27
ID: 9727214
I know it's a bitmap, but when i try input some *.bmp, it show very bad, i want to know what color of image will be transparent and save bitmap on 8 bit, 24 bit... is best.  
0
 
LVL 1

Accepted Solution

by:
Comboy earned 200 total points
ID: 9754607
Hi z27,
Use this code and let me if I've solved your problem ;)

procedure bmp2ico(Image: TImage; FileName: TFilename);
var
  Bmp: TBitmap;
  Icon: TIcon;
  ImageList: TImageList;
begin
  Bmp  := TBitmap.Create;
  Icon := TIcon.Create;
  try
    Bmp.Assign(Image.Picture);
    ImageList := TImageList.CreateSize(Bmp.Width, Bmp.Height);
    try
      ImageList.AddMasked(Bmp, Bmp.TransparentColor);
      ImageList.GetIcon(0, Icon);
      Icon.SaveToFile(FileName);
    finally
      ImageList.Free;
    end;
  finally
    Bmp.Free;
    Icon.Free;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  bmp2ico(Image1, 'c:\test.ico');
end;

Bye till...

Comboy
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this Micro Tutorial viewers will learn the basic shortcuts and functions in InDesign.
Learn the basics of inputting and editing your text components in Prezi. We will cover how to set styles, position, and group your text components. In your Prezi editor, click anywhere on the canvas to add text: A flashing cursor informs you that yo…
Suggested Courses

650 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