Saturday, November 01, 2003

Bilinear interpolation is much better for soft shadows.

Some time ago I published an article in GDI+ FAQ which explained how to create soft shadows for text. It took advantage of the interpolation mode used during bit blitting of images to create the fuzzy edged effect on text. Basically, the idea is that you create a memory bitmap upon which to draw all the text. This bitmap is then shrunk to half or 1/4 its original size thereby reducing its resolution. When this bitmap is copied back to the screen it's expanded again by two or four times, depending upon the original reduction, and the interpolation mode anti-aliases the edges of the text to create a fuzzy edge. I've just been using this effect in a program I designed for client and have discovered that the bilinear interpretation is far better than the bicubic. I must update the article in the GDI+ FAQ.

No comments: