Editor opacity programmatically

Hello guys, 

I'm writing a plugin to set background images, I've managed to set the directory where the images are, configure time but I would like to insert a JSlider where the user will change the opacity.

To change background image I'm using PropertiesComponent 

PropertiesComponent prop = PropertiesComponent.getInstance();
prop.setValue(IdeBackgroundUtil.EDITOR_PROP, image);
IdeBackgroundUtil.repaintAllWindows();

But how can I set the opacity?

Thank you,
Allan

2

And if possible, how to change images smoothly, there's any transition effect or something like that?

Thanks! 

0

Image spec is: <file-path-or-URL>[,<opacity>[,<fill-type>[,<placement>]]]

1. opacity: number in percents

2. fill type: PLAIN, SCALE, TILE

3. placement: CENTER, TOP_CENTER, BOTTOM_CENTER, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT

 

Here's the related code:

https://github.com/JetBrains/intellij-community/blob/master/platform/platform-impl/src/com/intellij/openapi/wm/impl/PaintersHelper.java#L231

 

No transitions or animations, because full repaint is required due to subpixel text antialiasing

1

请先登录再写评论。