Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Creating Alpha Icons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Creating Alpha Icons

 Post Reply Post Reply
Author
Message
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Topic: Creating Alpha Icons
    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


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

Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post 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 -?

Back to Top
Kappy View Drop Down
Newbie
Newbie


Joined: 08 April 2004
Location: Canada
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kappy Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.