How do I show Application.Icon on a form?

I want to make a generic About box that pulls all the info from the Version resource information in the .EXE.  I have written 98% of it, but now I'm stuck.  I want to display the program icon on the About box, but I don't want to have to read it from a file, I want to use the image in Application.Icon.

However, one cannot put a TIcon object on a form, and cannot assign a TIcon iamge to a TImage image, so how can I achieve this?

If I cannot take it directly from the Application object, how would I read is from the resource info in the .EXE?
LVL 2
DrBeakerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Mohammed NasmanConnect With a Mentor Software DeveloperCommented:
Hello

  if you want the read the application icon and put it in the image components, that's easy

  Image1.Picture.Assign(application.icon);

Best regards
Mohammed Nasman
0
 
CrazyOneCommented:
Try this


Image1.Picture.Icon := Application.Icon;


The Crazy One
0
 
Mohammed NasmanSoftware DeveloperCommented:
damn slow :(
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
DrBeakerAuthor Commented:
I actually did it by

DrawIcom(Image1.Canvass.Handle, 0, 0, Application.Icon,Handle);

which has got to be the fastest way ... unless anyone can see a problem here?
0
 
DrBeakerAuthor Commented:
Image1.Picture.Icon.Assign(application.icon);

Also seems to work.
0
 
DrBeakerAuthor Commented:
CrazyOne, I strongly suspect that, in some circumstances (specifically repalcing an icon), your solution could cause a memory leak.  If you use it yourself, consider replacing it with Assign calls.
0
All Courses

From novice to tech pro — start learning today.