Webcam Light

Share your advanced PureBasic knowledge/code with the community.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Webcam Light

Post by chris319 »

This silly little program opens a resizeable window on your screen.

The light emitted from the window can be used to illuminate a subject in front of a screen which may be appearing on a webcam.

You can easily control the color of the light emitted by the window. The default orange color adds some red to the image, definitely improving the appearance of the image.

To be really ambitious you could run this program on a separate screen or device and use the screen or device as a webcam light. You could also fuss with the brightness/contrast to control the intensity of the light.

Code: Select all

OpenWindow(1,0,0,640,360,"Webcam Light",#PB_Window_SizeGadget|#PB_Window_SystemMenu)

SetWindowColor(1,RGB(255,128,0))

Repeat

event = WaitWindowEvent()

Select event

Case #PB_Event_CloseWindow
  CloseWindow(1)
  End

EndSelect

ForEver
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Webcam Light

Post by walbus »

Code a little optimized :wink:

Code: Select all

OpenWindow( 1, 0, 0, 640, 360, "Webcam Light", #PB_Window_SizeGadget | #PB_Window_SystemMenu )
SetWindowColor( 1, $FFFFFF )
While WaitWindowEvent() <> #PB_Event_CloseWindow : Wend
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Webcam Light

Post by luis »

Poor Tricks'n'Tips section.

Now I've seen it all :lol:
"Have you tried turning it off and on again ?"
A little PureBasic review
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Webcam Light

Post by walbus »

@luis
My answer above was a Joke LOL
I think we want very urgent a forum for beginners for this things 8)
We have not, so , the only right place for this post is the Trashcan...
It's a little sadly for the guy, not good
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: Webcam Light

Post by chris319 »

the only right place for this post is the Trashcan...
Then why did you bother to "optimize" and post the code?

Basically all you did was to change the color.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Webcam Light

Post by walbus »

It's now much brighter Chris, you can even get a sunburn of it 8)
Sorry, but, how can you post such a crap here ?
Last edited by walbus on Fri Jun 30, 2017 9:12 pm, edited 1 time in total.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: Webcam Light

Post by chris319 »

It's now much brighter Chris, you can even get a sunburn of it 8)
Sorry, but, wow can you post such a crap ?
You're devoting a little too much attention to a "crap" program.

Pay attention before you trash other people's programs:
The default orange color adds some red to the image, definitely improving the appearance.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Webcam Light

Post by walbus »

Sorry chris, but I will not discuss with you
Everything has its limits !
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Webcam Light

Post by Sicro »

I think his idea is not so bad.

Probably his idea is not yet understood correctly.
Its code creates a window with a monochrome background. This window causes the PC monitor to radiate this color to the PC user or to a object. The PC monitor is thus used as a replacement for a lamp for the webcam.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: Webcam Light

Post by chris319 »

Its code creates a window with a monochrome background. This window causes the PC monitor to radiate this color to the PC user or to a object. The PC monitor is thus used as a replacement for a lamp for the webcam.
Precisely :)

You're a smart guy.

It illuminates the user's face at approximately eye level if he's looking at the monitor.
Karellen
User
User
Posts: 82
Joined: Fri Aug 16, 2013 2:52 pm
Location: Germany

Re: Webcam Light

Post by Karellen »

I remember a video chat I once had. My image looked awful. Because it was about job offer I felt very mad about this.

I'll keep your simple but clever idea in mind, thanks! :D
Stanley decided to go to the meeting room...
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Webcam Light

Post by walbus »

@Sicro, Karellen
You can simple open a window on your desktop
Or you can enhance the desktop brightness and color :shock:
You can also turn on the light in the room (cool)
Most do not sit in the dark in front of the webcam
Most do not sit with red light in front of the webcam
A code that only opens a window does not belong here, this is programming for preschool children !
Sorry, but, i self think, this is the stup...st thread this year :lol:
Last edited by walbus on Sat Jul 01, 2017 8:46 am, edited 1 time in total.
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Webcam Light

Post by Mijikai »

Adjust brightness with mousewheel 8)

Code: Select all

If OpenWindow(1,0,0,640,360,"Webcam Light",#PB_Window_SizeGadget|#PB_Window_SystemMenu|#PB_Window_MaximizeGadget) 
  Repeat: Select WaitWindowEvent()
      Case #PB_Event_CloseWindow: Break
      Case #WM_MOUSEWHEEL: If C > 255: C = 0: EndIf: SetWindowColor(1,RGB(C,C,C)): C + 42
  EndSelect: ForEver
EndIf
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: Webcam Light

Post by walbus »

Incredible new code LOL
Last edited by walbus on Sat Jul 01, 2017 7:53 pm, edited 1 time in total.
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Webcam Light

Post by Mijikai »

walbus wrote:Incredible new code LOL
Basically i just reposted an improved version of ur "joke"...
If it failed im not the one to blame - obviously.
Post Reply