Kjell
Kjell

Reputation: 781

Turn off part of the iPhone Screen

I'm trying to work on an iOS app that turns off the screen (so that when you are in the dark, it doesn't show any light at all), but I can turn on and off certain pixels of the screen.

Does anyone know a way to do this? I am assuming that it's either all or nothing... Either turn off all the screen, or turn it all on, but maybe someone knows better?

I am guessing that the best I could do is turn the background black so that as little light as possible comes through. However, I tried this using my iPad and it still generates too much light in a pitch black room. I want for instance, only 1 pixel to shine brightly, and the rest to not glow at all. And if this is not possible, is there any way to mimic this?

Upvotes: 0

Views: 736

Answers (3)

Mick MacCallum
Mick MacCallum

Reputation: 130193

I'm afraid I agree with @garretmurray. What you're trying to do just isn't possible. You're on the best track though.

You can change the background color of the view you're on to black, and use the following to kill the screen's brightness:

[[UIScreen mainScreen] setBrightness:0.0f];

Upvotes: 2

Nicholas Smith
Nicholas Smith

Reputation: 11754

As far as I'm aware the screen is either on or off, there's no controller for setting specific regions to on/off.

Also you can't change the pixel level brightness, as the screen isn't illuminated that way. You can only control the overall screen brightness, not each pixel, as the screen lighting technology doesn't work that way, it's specifically an LED backlight.

Upvotes: 2

garrettmurray
garrettmurray

Reputation: 3368

What you're trying to do is not possible.

Upvotes: 0

Related Questions