AForge.Robotics.Surveyor.SRV1.SetQuality C# (CSharp) Method

SetQuality() public method

Set video quality.

The method sets video quality, which is specified in [1, 8] range - 1 is the highest quality level, 8 is the lowest quality level.

Setting higher quality level and resolution may increase delays for other requests sent to SRV-1. So if robot is used not only for video, but also for controlling servos/motors, and higher response level is required, then do not set very high quality and resolution.

Invalid quality level was specified.
public SetQuality ( int quality ) : void
quality int Video quality to set, [1, 8].
return void
        public void SetQuality( int quality )
        {
            if ( ( quality < 1 ) || ( quality > 8 ) )
                throw new ArgumentOutOfRangeException( "Invalid quality level was specified." );

            Send( new byte[] { (byte) 'q', (byte) ( quality + (byte) '0' ) } );
        }

Usage Example

Example #1
0
 /// <summary>
 /// Set video quality.
 /// </summary>
 ///
 /// <param name="quality">Video quality to set, [1, 8].</param>
 ///
 /// <remarks><para>The method sets video quality, which is specified in [1, 8] range - 1 is
 /// the highest quality level, 8 is the lowest quality level.</para>
 ///
 /// <para><note>Setting higher quality level and <see cref="SetResolution">resolution</see>
 /// may increase delays for other requests processed by <see cref="SRV1"/> class. So if
 /// robot is used not only for video, but also for controlling servos/motors, and higher
 /// response level is required, then do not set very high quality and resolution.
 /// </note></para>
 /// </remarks>
 ///
 /// <exception cref="ArgumentOutOfRangeException">Invalid quality level was specified.</exception>
 ///
 public void SetQuality(int quality)
 {
     communicator.SetQuality(quality);
 }