Search code examples
javaswingscreenshotopacityjwindow

JWindow region opacity


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!


Solution

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

    Partially transparent window