Solved

Using ImageList, transparent icons look ungly

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
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 new code templates in NetBeans IDE 8.0 for Windows.

691 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