JWindow region opacity

2019-08-08 09:09发布

问题:

I want to implement a screenshot functionality like in snipping tool. I can already select a rectangle and make a screenshot, but I this rectangle to be full opacity.

I wonder if there is a function in Swing or AWT which I can use like this:

window.setOpacityAt(Rectangle r, 0.5f);

I hope you got my problem!

回答1:

See How to Create Translucent and Shaped Windows: How to Implement Per-Pixel Translucency.