Search code examples
windows-xpgdishadowdrawtext

How to draw text with a shadow like Windows XP does on Desktop icons?


Windows XP draws icon text with a nice shadow, which helps to read the text on various backgrounds. The font color is white and the shadow is black (if desktop background is white) or there is no shadow at all (if desktop background is black).

So there are two sub-tasks:

  1. How the shadow gets drawn? It is not a simple x,y offset of the text; the shadow looks more like a blur to me.

  2. How to make shadow to behave the way it becomes more visible on white backgrounds and less visible on dark?

I need a solution for GDI (not GDI+).


Solution

  • Please read Glow and Shadow Effects using Windows GDI.