Domanda

I know how to change brightness of entire window:

float brightness = 255;
brightness = brightness / (float) 255;
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = brightness;
getWindow().setAttributes(lp);

but is it possible to set brightness to different parts of the screen?

I want reach something like this:

img

or this:

enter image description here

È stato utile?

Soluzione

Android API doesn't provide any means to achieve that(I've head a similar problem. Didn't find any solution).

Altri suggerimenti

There are no Api's to do that like GareginSargsyan said.

However,

By Using a grey or black tint (create one in photoshop or some application) wherever you want the screen to be dimmer than the other (this image should be a see through one like a .png image). call this image(coloured tint) in your program through xml or java.

Try it..

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top