GainInfo Property

Summary
Helper property to get the range, default value, and other information for theGainproperty.
Syntax
C#
VB
C++
publicVideoProcAmpInfoGainInfo {get; }
PublicReadOnlyPropertyGainInfoAsVideoProcAmpInfo
public:propertyVideoProcAmpInfo^GainInfo {VideoProcAmpInfo^get();}

Property Value

AVideoProcAmpInfoobject.

Remarks

The information returned for this property is aVideoProcAmpInfoobject containing all the related property information.

Example
C#
VB
usingLeadtools;usingLeadtools.Multimedia;usingLeadtoolsMultimediaExamples.Fixtures;publicbool_result =false;publicCaptureCtrlForm _form =newCaptureCtrlForm();publicVideoProcAmp _videoprocamp;publicstring_outFile = Path.Combine(LEAD_VARS.MediaDir,"VideoProcAmp_SetAutoValueExample.avi");// this example demonstrates how to set an auto value on the// video proc amp object.publicvoidSetManualValueExample(){// reference the capture controlCaptureCtrl capturectrl = _form.CaptureCtrl;try{// select the first device with Logitech in it's name// Replace "Logitech" with your video capture device nameif(capturectrl.VideoDevices["Logitech"] ==null)thrownewException("No Logitech video devices available!");capturectrl.VideoDevices["Logitech"].Selected =true;// set a video compressorcapturectrl.VideoCompressors.Mpeg2.Selected =true;// set the target filecapturectrl.TargetFile = _outFile;// reference the video proc amp_videoprocamp = capturectrl.VideoProcAmp;// try to set the auto valueif(_videoprocamp !=null){// set the saturation to the maximum supported value_videoprocamp.Saturation = _videoprocamp.SaturationInfo.Max;// set the sharpness to the minimum value_videoprocamp.Sharpness = _videoprocamp.SharpnessInfo.Min;// set the white balace to the maximum value_videoprocamp.WhiteBalance = _videoprocamp.WhiteBalanceInfo.Max;// set the hue to the minimum value// later in the timer we will bump this value using the stepDelta_videoprocamp.Hue = _videoprocamp.HueInfo.Min;// subscribe to the capture progress event// so we can play with the hue setting abovecapturectrl.Progress +=newProgressEventHandler(CaptureCtrl_Progress);}// check for video capture availableif(capturectrl.IsModeAvailable(CaptureMode.Video)){// capture 15 seconds of videocapturectrl.UseTimeLimit =true;capturectrl.TimeLimit = 15;// subscribe to the compete eventcapturectrl.Complete +=newEventHandler(CaptureCtrl_Complete);// start the capturecapturectrl.StartCapture(CaptureMode.Video);}}catch(Exception){_result =false;}// we'll loop on the state and pump messages for this example.// but you should not need to if running from a Windows Forms application.while(capturectrl.State == CaptureState.Running)Application.DoEvents();}voidCaptureCtrl_Progress(objectsender, ProgressEventArgs e){if(_videoprocamp !=null){// roll the hue value around while capturing_videoprocamp.Hue += _videoprocamp.HueInfo.StepDelta;// reset it to the minimum if we reach the maxif(_videoprocamp.Hue >= _videoprocamp.HueInfo.Max)_videoprocamp.Hue = _videoprocamp.HueInfo.Min;}}voidCaptureCtrl_Complete(objectsender, EventArgs e){// set the result to what we expect_result = File.Exists(_outFile);}staticclassLEAD_VARS{publicconststringMediaDir =@"C:\LEADTOOLS21\Media";}
ImportsLeadtoolsImportsLeadtools.MultimediaImportsLeadtoolsMultimediaExamples.FixturesPublic_resultAsBoolean=FalsePublic_formAsCaptureCtrlForm =NewCaptureCtrlForm()Public_videoprocampAsVideoProcAmpPublic_outFileAsString= Path.Combine(LEAD_VARS.MediaDir,"VideoProcAmp_SetAutoValueExample.avi")' this example demonstrates how to set an auto value on the' video proc amp object.PublicSubSetManualValueExample()' reference the capture controlDimcapturectrlAsCaptureCtrl = _form.CaptureCtrlTry' select the first device with analog in it's name' Replace "Analog" with your video capture device nameIfcapturectrl.VideoDevices("Logitech")IsNothingThenThrowNewException("No Logitech video devices available!")EndIfcapturectrl.VideoDevices("Logitech").Selected =True' set a video compressorcapturectrl.VideoCompressors.Mpeg2.Selected =True' set the target filecapturectrl.TargetFile = _outFile' reference the video proc amp_videoprocamp = capturectrl.VideoProcAmp' try to set the auto valueIfNot_videoprocampIsNothingThen' set the saturation to the maximum supported value_videoprocamp.Saturation = _videoprocamp.SaturationInfo.Max' set the sharpness to the minimum value_videoprocamp.Sharpness = _videoprocamp.SharpnessInfo.Min' set the white balace to the maximum value_videoprocamp.WhiteBalance = _videoprocamp.WhiteBalanceInfo.Max' set the hue to the minimum value' later in the timer we will bump this value using the stepDelta_videoprocamp.Hue = _videoprocamp.HueInfo.Min' subscribe to the capture progress event' so we can play with the hue setting aboveAddHandlercapturectrl.Progress,AddressOfCaptureCtrl_ProgressEndIf' check for video capture availableIfcapturectrl.IsModeAvailable(CaptureMode.Video)Then' capture 15 seconds of videocapturectrl.UseTimeLimit =Truecapturectrl.TimeLimit = 15' subscribe to the compete eventAddHandlercapturectrl.Complete,AddressOfCaptureCtrl_Complete' start the capturecapturectrl.StartCapture(CaptureMode.Video)EndIfCatche1AsException_result =FalseEndTry' we'll loop on the state and pump messages for this example.' but you should not need to if running from a Windows Forms application.DoWhilecapturectrl.State = CaptureState.RunningApplication.DoEvents()LoopEndSubPrivateSubCaptureCtrl_Progress(ByValsenderAsObject,ByValeAsProgressEventArgs)IfNot_videoprocampIsNothingThen' roll the hue value around while capturing_videoprocamp.Hue += _videoprocamp.HueInfo.StepDelta' reset it to the minimum if we reach the maxIf_videoprocamp.Hue >= _videoprocamp.HueInfo.MaxThen_videoprocamp.Hue = _videoprocamp.HueInfo.MinEndIfEndIfEndSubPrivateSubCaptureCtrl_Complete(ByValsenderAsObject,ByValeAsEventArgs)' set the result to what we expect_result = File.Exists(_outFile)EndSubPublicNotInheritableClassLEAD_VARSPublicConstMediaDirAsString="C:\LEADTOOLS21\Media"EndClass
Requirements

Target Platforms

Leadtools.Multimedia Assembly
188金宝搏的网址客服|Support|Contact Us|Intellectual Property Notices
© 1991-2021LEAD Technologies, Inc.All Rights Reserved.