Solved

Convert bitmap or icon to Glyph

Posted on 2003-11-10
3
1,097 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
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 50 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

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
Flickr - Upload with photoshop elements 14 - wrong date 4 26
graphic software 6 89
Pinnacle Studio 19 5 31
Delphi...Split view - idea? 1 42
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Add visuals to your Prezi to keep your audience engaged. Learn how to embed images, edit them, and more in this video micro tutorial. Select "Insert" from the top menu in your Prezi editor: Select "Image": A toolbar will pop in from the right …

920 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

12 Experts available now in Live!

Get 1:1 Help Now