HI
Trying to capture a file to my drive using CaptureSingleFrameTo
Here is the script
SharpCap.SelectedCamera = SharpCap.Cameras [0] # Open the first camera in the Cameras menu and start previewing it
time.sleep(4)
SharpCap.SelectedCamera.Controls.OutputFormat.Value = "TIF files (*.tif)"
SharpCap.SelectedCamera.CaptureSingleFrameTo("d:\shared\test.tif")
SharpCap.SelectedCamera = None # close camera
The problem:
The Sharpcap msg banner says it captured to D:\\shared_est.tif
How would I capture to a sub directory?
Thanks
CaptureSingleFrameTo issue
- admin
- Site Admin
- Posts: 13473
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: CaptureSingleFrameTo issue
Hi,
the '\' is an escape character in python, so you are \t gets you a tab (not sure what \s is). Use double backslash if you want an actual backslash character in the string.
cheers,
Robin
the '\' is an escape character in python, so you are \t gets you a tab (not sure what \s is). Use double backslash if you want an actual backslash character in the string.
Code: Select all
SharpCap.SelectedCamera.CaptureSingleFrameTo("d:\\shared\\test.tif")
Robin