Solved

Using ImageList, transparent icons look ungly

Posted on 2008-10-21
4
2,282 Views
Last Modified: 2013-11-23
Hi.

I have to use almost 20 icons depending on an event.
So i've used an ImageList to handle those icons (96x96) and load them to the Timage.
But the loaded icon looks ... well very ugly.
The code :

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
var
  b: TIcon;
begin
  b := TIcon.Create;
  If (condition) then .......ImageList1.GetIcon(5,b); .....  Image6.Picture.Assign(b);.......
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I have set the drawing style to transparent, but no joy.
When i load to the TImage the icons one by one from a file, the result is fine.
But i want to hold those icons inside the executable.

Is there something wrong with the code?
Is there another ImageList component that handle icons better (free)?

Thanks in advance.
0
Comment
Question by:CodedK
  • 3
4 Comments
 
LVL 15

Assisted Solution

by:mikelittlewood
mikelittlewood earned 250 total points
ID: 22765986
Try not using an imageList and use the .res (resource) file instead to store them, you should get better results.
0
 
LVL 15

Assisted Solution

by:mikelittlewood
mikelittlewood earned 250 total points
ID: 22766012
Take a look at this PAQ on using icons from a resource file

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20856460.html
0
 
LVL 16

Accepted Solution

by:
CodedK earned 0 total points
ID: 22766353
Hi mikelittlewood.

Thats the only logical solution besides using a nice component.
...But too much code-trouble for nothing.

I found "32 bit Image List v.1.0" by MCoP, and it works great :)
0
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 22767582
Fair enough, glad you found a solution though :o)
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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

862 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

23 Experts available now in Live!

Get 1:1 Help Now