Solved

How do I show Application.Icon on a form?

Posted on 2001-07-15
6
150 Views
Last Modified: 2010-04-06
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?
0
Comment
Question by:DrBeaker
  • 3
  • 2
6 Comments
 
LVL 44

Expert Comment

by:CrazyOne
Comment Utility
Try this


Image1.Picture.Icon := Application.Icon;


The Crazy One
0
 
LVL 22

Accepted Solution

by:
mnasman earned 100 total points
Comment Utility
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
 
LVL 22

Expert Comment

by:mnasman
Comment Utility
damn slow :(
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 2

Author Comment

by:DrBeaker
Comment Utility
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
 
LVL 2

Author Comment

by:DrBeaker
Comment Utility
Image1.Picture.Icon.Assign(application.icon);

Also seems to work.
0
 
LVL 2

Author Comment

by:DrBeaker
Comment Utility
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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

744 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

17 Experts available now in Live!

Get 1:1 Help Now