This will enable you to take a photo with your internal webcam if you are having one, every time you login to your PC. For this to happen you have to compile the following mentioned Autoit code, build the .exe file and place it in your system startup folder. This would just keep a log of who logged into your system along with the date and time of login.
This is how my log folder looked after keeping this thing in my startup folder for 2 months...........
Well here's is the code. This thing uses the UDF webcam.au3 mentioned here as the library to call dlls required to capture the webcam frames.... So this webcam.au3 forms the library and we use the functions defined in it.
#include <Webcam.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;Creating a GUI just as it is necessary..
$xc = 0
$gui = GUICreate("My GUI", 900, 600)
;Initialising webcam but not displaying the GUI since we dont want to
;show that a photo is being taken...
_WebcamInit()
;Taking two shots inorder to avoid some of the errors which regularly occur in such cases
While($xc<2)
sleep(10)
;Passing Webcam stream to the GUI
_Webcam($gui,900,600,0,0)
$xc += 1
;Destination with name as current date and time
$file = "C:\Users\Dell\Desktop\junk\log\"&@MDAY&"z"&@MON&"z"&@YEAR&"z"&@HOUR&"z"&@MIN&"z"&@SEC&"z"&@MSEC&".bmp"
;Taking the snapshot.... and saving it to destination
_WebcamSnapShot($file )
sleep(1000)
WEnd
sleep(500)
;Stopping the webcam
_WebcamStop()
You can also download the code from here....
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;Creating a GUI just as it is necessary..
$xc = 0
$gui = GUICreate("My GUI", 900, 600)
;Initialising webcam but not displaying the GUI since we dont want to
;show that a photo is being taken...
_WebcamInit()
;Taking two shots inorder to avoid some of the errors which regularly occur in such cases
While($xc<2)
sleep(10)
;Passing Webcam stream to the GUI
_Webcam($gui,900,600,0,0)
$xc += 1
;Destination with name as current date and time
$file = "C:\Users\Dell\Desktop\junk\log\"&@MDAY&"z"&@MON&"z"&@YEAR&"z"&@HOUR&"z"&@MIN&"z"&@SEC&"z"&@MSEC&".bmp"
;Taking the snapshot.... and saving it to destination
_WebcamSnapShot($file )
sleep(1000)
WEnd
sleep(500)
;Stopping the webcam
_WebcamStop()
You can also download the code from here....
0 comments:
Post a Comment