Skip to navigation

PCPro-Computing in the Real World Printed from www.pcpro.co.uk

Register to receive our regular email newsletter at http://www.pcpro.co.uk/registration.

The newsletter contains links to our latest PC news, product reviews, features and how-to guides, plus special offers and competitions.

Real World Computing

Apps versus solutions

Posted on 4 Mar 2009 at 11:04

Simon Jones asserts that "solution" isn't a dirty word, and finds some powerful code-optimisation tools.

Dim objBitmap As Bitmap = My.Resources.Activity_Large

objBitmap.MakeTransparent(Color.Magenta)

MyControl.Image = objBitmap

There's nothing to stop bitmaps or icons containing 32 bits per pixel - one byte each for red, green, blue and transparency, which is often referred to as RGBA or RGB/A. Forms and controls within Visual Studio can use them all, but its icon and bitmap editors can't: they appear stuck in the dark ages of 8-bit colour. You get no help in creating various different sizes of an icon either, it being left up to you to manually add the sizes you want and then copy the image and resize it to each different size. Prior to VS2008 you couldn't even have an icon larger than 32 x 32 pixels, but Windows Vista supports icons from 16 x 16 all the way up to 256 x 256, and intelligently scales up or down from each fixed size when an in-between size is requested. The most commonly used sizes are 16 x 16 or 32 x 32 for the small and large icons on toolbars and menus, while 24 x 24 and 48 x 48 pixels are less common and are used for medium-sized buttons and "tiles" in Explorer listings respectively. The largest sizes - 64 x 64, 128 x 128 and 256 x 256 - are really only used by Windows Vista for applications and documents when being shown "extra large".

Axialis IconWorkshop can fix most of these problems. It isn't free - costing $70 for the full Professional version, but only $50 for a cut-down Home version for non-commercial use. IconWorkshop lets you design icons by dragging and dropping image parts onto its design surface. Starting with an empty 256 x 256 icon frame you could, for instance, drag pictures of the back of a folder, a document, the front of a folder and that small yellow star used to symbolise "new", onto the design surface and quickly set the "new" star to be partially transparent, before clicking just a single button to spawn all the other icon sizes you want. The program will intelligently scale down your image to your chosen sizes, and then allow you to clean up any that need extra touching up. Within each image in your icon file you'll have access to the full range of painting tools such as the pencil, pen, flood fill, line, rectangle, oval, gradients, text, rotation and so on. There are also more advanced tools that sharpen, smooth, blur or emboss images or parts of images, as well as create icons from an existing image. You can export an icon of any size into another file format such as PNG (Portable Network Graphics), including all its transparency information. Alternatively, you can replace the transparency information with a chosen colour such as magenta, but of course that reduces the colour depth from 32 bits per pixel to 24, and throws away the advantage of smooth blending using the alpha channel. Exporting to PNG satisfies the requirements of other control libraries such as Infragistics NetAdvantage, where images are added as individual bitmaps of a defined size, rather than as a single icon file that contains multiple sizes.

IconWorkshop integrates with Visual Studio 2005 and 2008, but it doesn't appear inside the Visual Studio IDE (Integrated Development Environment) - you launch it from within Visual Studio by double-clicking on an icon file in the Resource Window or Project Explorer. It's powerful and much easier to use than the icon and bitmap editors built into Visual Studio, and it has a couple of other advantages. First, a licence covers all updates to the product in perpetuity, not just for a year or until the next major version; and second, purchasing it gives you access to libraries of hundreds of predefined icons and icon parts from which to build your own. Get it from www.axialis.com/iconworkshop.

1 2 3 4
Be the first to comment this article

You need to Login or Register to comment.

(optional)

advertisement

Latest Real World Computing
Latest Blog Posts Subscribe to our RSS Feeds
Latest News Stories Subscribe to our RSS Feeds
Latest Reviews Subscribe to our RSS Feeds

advertisement

Sponsored Links
 
SEARCH
SIGN UP

Your email:

Your password:

remember me

advertisement


Hitwise Top 10 Website 2008