Solved

Convert bitmap or icon to Glyph

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
D3, dragging and rotating. 7 97
VCD to mp4 11 103
can someone convert this into a jpeg 5 82
Base1 Encode/Decode 3 39
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
In this second Micro Tutorial in the series,  viewers will learn more basic shortcuts and functions of Illustrator. In this tutorial you will learn about the eyedropper tool, zoom , ellipses and more.
In this Micro Tutorial viewers will learn the basic shortcuts and functions in InDesign.

743 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

14 Experts available now in Live!

Get 1:1 Help Now