문제

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

도움이 되었습니까?

해결책

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

다른 팁

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..

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top