Saturday, May 12, 2007

Easier Alpha Masks

The per-pixel alpha masking in this post has been codified into a simple API.

WindowUtils.setWindowTransparent(Window w, boolean transparent);

This effectively gives the window a transparent background. The alpha levels of the window's contents are preserved.

The demo is similar to the previous one but adds a few standard components to the mix.

UPDATE If you have a linux system and this for some reason doesn't work, please post a comment to that effect, or post a message to so we can ensure this works reliably across all linux systems (64-bit is in the works).