Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I show Application.Icon on a form?

Posted on 2001-07-15
6
Medium Priority
?
161 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
[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
  • 2
6 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6284060
Try this


Image1.Picture.Icon := Application.Icon;


The Crazy One
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 200 total points
ID: 6284068
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:Mohammed Nasman
ID: 6284070
damn slow :(
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:DrBeaker
ID: 6284320
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
ID: 6284326
Image1.Picture.Icon.Assign(application.icon);

Also seems to work.
0
 
LVL 2

Author Comment

by:DrBeaker
ID: 6284353
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

636 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