Closed ali-imanpour closed 2 years ago
Hello.
This is a sample code modifying exposure and gain. It is no guarantee to support those properties in your camera, you had better check prop.Available property before use.
UsbCamera.PropertyItems.Property prop;
prop = camera.Properties[DirectShow.CameraControlProperty.Exposure];
if (prop.Available)
{
prop.SetValue(DirectShow.CameraControlFlags.Manual, prop.Default);
}
prop = camera.Properties[DirectShow.VideoProcAmpProperty.Gain];
if (prop.Available && prop.CanAuto)
{
prop.SetValue(DirectShow.CameraControlFlags.Auto, 0);
}
How can I set gain and exposure time?