torsdag 9 februari 2012

Give your webcam some PS love…


#You may need to download the Windows Image Acquisition #Automation Library
#Depending on your current OS-setup
#http://www.microsoft.com/download/en/details.aspx?id=18287
#Some more reference information regarding the WIAAL can be found #on MSDN.
#http://msdn.microsoft.com/en-us/windows/hardware/gg463497

#Create a Windows Image Acquisition object
$WIAdialog = New-Object -ComObject “WIA.CommonDialog”

#Initiate the camera device
$device = $WIAdialog.ShowSelectDevice()

#Taking picture
$device.executecommand(’{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}’)

#Store the last picture taken to a JPEG-container
(($device.Items.Item($device.Items.Count)).Transfer()).SaveFile(”C:\TEMP\test.jpg”)