Drawing "dimmed" bitmaps

I'm after some code to draw a bitmap as "dimmed" a la the Windows 95/NT
desktop icons and treeview images when they are selected.

Any help appreciated.