Creating Alpha Icons
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=857
Printed Date: 02 August 2025 at 10:35am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Creating Alpha Icons
Posted By: Ark42
Subject: Creating Alpha Icons
Date Posted: 17 June 2004 at 5:22pm
I had a problem with not much software supporting creating 32bpp
images, and the programs I did have only supported PNG/TGA/TIF, not BMP
or ICO, and even then it can be a pain to work with 32bpp images
somtimes. So here is a little command line utility I whipped up that
can convert, split, and join 8/24/32bpp images in PNG/TGA/TIF/BMP/ICO
formats:
http://ark42.com/freeimage/alphahlp.exe - http://ark42.com/freeimage/alphahlp.exe
C:\>alphahlp
Usage:
To convert from one format to another:
alphahlp -f(ext) -c(ext) from_filename to_filename
To split a 32bpp image into a 24bpp image and an 8bpp image:
alphahlp -f(ext) -s 32bpp_filename 24bpp_filename 8bpp_filename
To join a 24bpp image and an 8bpp image to form a 32bpp image:
alphahlp -f(ext) -j 24bpp_filename 8bpp_filename 32bpp_filename
ext must be one of png, tga, tif, bmp, or ico
|
Replies:
Posted By: Ark42
Date Posted: 17 June 2004 at 5:29pm
One suggestion for the Codejock library I would like to see is that currently I use:
XTPImageManager()->SetMaskColor(RGB(0, 0, 0));
XTPImageManager()->SetIcons(bmAlphaIcons,
nIDMenuBarIcon s, _countof(nIDMenuBarIcons), CSize(16, 16),
xtpImageNormal, XTPImageManager()->IsAlphaIconsSupported());
Instead of SetMaskColor how about SetAlphaThreshhold so that you can,
say, use all of the pixels that have an alpha value >=128 instead?
|
Posted By: Ark42
Date Posted: 18 June 2004 at 11:52pm
I needed more features still, to deal with multiple formats in a .ico
file as well as to automate tiled images where you have lots of little
images all in one big file, so here is v2.0...
AlphaHlp v2.0 Usage:
To convert from one format to another:
alphahlp -f(ext) -c(ext) from_filename to_filename
To split a 32bpp image into a 24bpp image and an 8bpp image:
alphahlp -f(ext) -s 32bpp_filename 24bpp_filename 8bpp_filename
To join a 24bpp image and an 8bpp image to form a 32bpp image:
alphahlp -f(ext) -j 24bpp_filename 8bpp_filename 32bpp_filename
To split a multipage image into one singlepage file per page:
alphahlp -f(ext) -m multipage_filename file_prefix file_suffix
To append a singlepage image to a multipage image:
alphahlp -f(ext) -a multipage_filename singlepage_filename
To split a tiled image into one smaller image per tile:
alphahlp -f(ext) -t -w# -h# tiled_filename file_prefix file_suffix
To insert a single tile into a tiled image:
alphahlp -f(ext) -i -w# -h# -c# tiled_filename singletile_filename
More details:
alphahlp -?
|
Posted By: Kappy
Date Posted: 24 August 2004 at 1:40pm
Thanks for the utility, Ark! It is exactly what I need. It is strangely bizzarre how nothing supportes 32-bit bmps. Now the XTPro seems to have the alpha issues sorted out (v9.10) I am going to try and use them in a new product.
|
Posted By: Ark42
Date Posted: 24 August 2004 at 1:48pm
Glad somebody liked it :)
Make sure you have v2.2 - I think I posted it to my site, but maybe
not. It fixes a couple minor bugs, I think TGA files were messed up for
one thing.
|
|