Software
Delphi and Lazarus
Trekking and Events
Blog and Forum
Čeština English
Main menu
Delphi and Lazarus
Useful Links

interesting webs & galleries of my friends:

F-Web

Máša&Pája Gallery

Delphi and Lazarus:

Embarcadero/ CodeGear

Lazarus project

Torry's Delphi pages

JEDI Code Library

 

KIcon

Another component that is sometimes useful. This component makes sense if a more complex manipulation with icons (or better icon files *.ico) than just viewing is needed.

I was googling for a suitable component in January 2005 and although i found many components, there was always some problem with them. The main issue was a lack of versatility, i.e. the ability to display any icon - inclusive 32-bit icons with alpha channel - in any 32-bit Windows system (KIcon does this, not tested on a 64-bit system).

KIcon features
32-bit icons and cursors supported
Full PNG icon image support (up to Delphi 2007 PngImage component is needed)
Correct rendering in all 32-bit Windows
Optionally all icon images can be drawn
Icons can be stretched when drawn
Except for the normal rendering the sole color image (image information) or the sole mask (transparency) can be drawn
Icons can be loaded from an ico file, stream, HICON, module resources (exe or dll), associated modules (file associations)
Icons can be saved into an ico file or stream
Icon image manipulation (inserting/deleting/cropping/enlarging)
full TPicture integration

Necessary packages

From version 1.8 none. Up to version 1.7 JEDI Code Library (JCL) - Version 1.100+ - download here.

KIcon downloads

Note: there are only stable packages here. For latest changes and hotfixes please download KControls.

FileVersionNumber of
downloads
Available tools:Changes
kicon_2.1.zip2.1501Delphi 6+, Lazarus 0.9.26+CopyToAlphaBitmap function fixed
kicon_2.0.zip2.0138Delphi 6+, Lazarus 0.9.26+fixed several bugs
kicon_1.9.zip1.955Delphi 6+, Lazarus 0.9.26+tiny changes due to the first release of KControls, 16.11.09 hotfix: ability to load some slightly corrupted icons, LoadFromModule png loading fixed, kcontrols.pas put into the package.
KIcon_1.8.zip1.8180Delphi 6+, Lazarus 0.9.26+doesn't need JCL, port to Lazarus(Win32), full PNG icon support
KIcon17.zip1.7339Delphi 6+Update for Delphi 2009, PNG read/write support, 256x256 pixel icon support
KIcon16.zip1.6489Delphi 6 till 2007Initial release on this web site

Screenshots (click the images to enlarge)

 
KIcon demo - big 32-bit image with alpha channel is shownThe same image but stretched
 
All icon images (horizontally displayed)Displaying without mask - 32-bit images do not need a mask here - alpha channel does this
 

Home | Software | Delphi and Lazarus | Trekking, travelling | Sport | Others | Blog

Search in comments: 
inserted: 2011-06-24 23:41:31   Reply...
From: yannick
Thank you for this library, great !!! I'd like to convert a JPEG file to an ICO file format with inside : 128_RGB, 48_RGG, 32_RGB, 16_RGB , 48_256, 32_256, 16_256. How to convert the source file directly into 256 color without ugly colors ? An other good idea will be to support compression for 256x256_RGB (supported with vista mini). Best regards.
inserted: 2010-11-20 05:57:52   Reply...
From: zizzo81
Hi tk, I've found your TKIcon component fabolous, but I have a problem. I've got a PNG image (with alpha channel) and I can't Add it to an icon. The only way I got for achieving this is to paste it to a TBitmap then adding it, losing the alpha channel this way. Could you please illuminate me? Thanks.
inserted: 2010-11-20 09:20:26   Reply...
From: tk
I'm sorry this is not supported yet. For next version I'll implement custom AddFrom... methods (for Delphi sth. like CopyToPng - per pixel copy). Until then please use an external tool to convert png to Vista icon.
inserted: 2008-10-16 15:57:32   Reply...
From: glob
is it possible with kicon to paint an icon's alpha transparency mask as a gray scale image? i know you can use an IconDrawStyle of idsMaskOnly to paint just the monochrome mask, however for an icon with alpha transparency this is not sufficient :( thanks :)
inserted: 2008-10-17 01:13:23   Reply...
From: tk
I made a new version 1.7 and it supports it via TIconDrawStyle.idsAlphaChannel.
My account
Top downloads
Recently modified

KControls Development Suite

by: tk

2010-11-08

KHexEditor

by: tk

2010-11-08

KGrid

by: tk

2010-11-08

KIcon

by: tk

2009-11-24

KGrid 1.3 released.

by: tk

2009-08-10

Recently inserted

KComponents as open source

by: tk

2011-04-16

Problem with comments and logins

by: tk

2010-01-29

KControls released

by: tk

2009-10-15

Working hard on KGrid update...

by: tk

2009-06-22

EMWD

by: tk

2007-12-03

No translation available

by: tk

2007-10-30