View Full Version : Auto Brightness Switch

September 21, 2010, 22:04:57
The following code gives an error "object reference not set to instance of an object" on the line that reads
BrightnessSwitch = Brightness.Elements.FindInterface(TIS.Imaging.VCDI Ds.VCDElement_Auto + ":" + TIS.Imaging.VCDIDs.VCDInterface_Switch)
I want to shut off the auto brightness programatically without user controls and I found this sample but cant seem to get it to work.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
IcImagingControl1.Device = "DFK 72AUC02"
IcImagingControl1.VideoFormat = "RGB32 (2592x1944)"
IcImagingControl1.DeviceFrameRate = "5"
IcImagingControl1.MemoryCurrentGrabberColorformat = TIS.Imaging.ICImagingControlColorformats.ICRGB32
'scale live display
IcImagingControl1.LiveDisplayDefault = False
IcImagingControl1.LiveDisplayHeight = IcImagingControl1.Height
IcImagingControl1.LiveDisplayWidth = IcImagingControl1.Width
'turn on live image overlays
IcImagingControl1.OverlayBitmap.Enable = True
IcImagingControl1.OverlayBitmap.ColorMode = TIS.Imaging.OverlayColorModes.Color
'turn off auto brightness
Dim Brightness As TIS.Imaging.VCDPropertyItem
Brightness = IcImagingControl1.VCDPropertyItems.FindItem(TIS.Im aging.VCDIDs.VCDID_Brightness)
Dim BrightnessSwitch As TIS.Imaging.VCDSwitchProperty
BrightnessSwitch = Brightness.Elements.FindInterface(TIS.Imaging.VCDI Ds.VCDElement_Auto + ":" + TIS.Imaging.VCDIDs.VCDInterface_Switch)
BrightnessSwitch.Switch = False
Catch ex As System.Exception
End Try
End Sub

Stefan Geissler
September 22, 2010, 08:40:00

As far as I know, the DFK 72 has no Auto Brightness property. Thus an interface to this property does not exist. Some other camera models may have an Auto Brightness property. You may have a look on Gain and Exposure auto too.