I'm trying to create an overlay with a Vista Aero Glass -like background in place of a normal window. Part of my answer seems to be here, but I'm wondering how to get a blur effect in Swing/AWT. This looks like a start:
public BufferedImage processImage(BufferedImage image) {
float[] blurMatrix = { 1.0f / 9.0f, 1.0f / 9.0f, 1.0f / 9.0f, 1.0f / 9.0f, 1.0f /
9.0f, 1.0f / 9.0f, 1.0f / 9.0f, 1.0f / 9.0f, 1.0f / 9.0f };
BufferedImageOp blurFilter = new ConvolveOp(new Kernel(3, 3, blurMatrix),
ConvolveOp.EDGE_NO_OP, null);
return blurFilter.filter(image, null);
}
...but I'd really like to get a close match. It seems the process should be:
- Blur the background image
- Paint over with a transparent grey (or whatever bg color you're going for)
- Then paint opaque window contents
If I get this right, I might throw in the Aero window border shadows.
Am I on the right track? How precisely should I do the blur to get the same look? Maybe someone has solved this problem already? (For reference, open the Vista start menu and look at the right side.)