Solved

Using ImageList, transparent icons look ungly

Posted on 2008-10-21
4
2,281 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
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…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

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

10 Experts available now in Live!

Get 1:1 Help Now