AForge.Video.Ximea.XimeaCamera.GetParamString C# (CSharp) Метод

GetParamString() публичный Метод

Get camera's parameter as string value.

See CameraParameter class for the list of some possible configuration parameters. See XIMEA documentation for the complete list of supported parameters.

An error occurred while communicating with a camera. See error /// message for additional information. No camera was opened, so can not access its methods.
public GetParamString ( string parameterName ) : string
parameterName string Parameter name to get from camera.
Результат string
        public string GetParamString( string parameterName )
        {
            lock ( sync )
            {
                CheckConnection( );

                byte[] bytes = new byte[260];
                int size = bytes.Length;
                ParameterType type = ParameterType.String;

                unsafe
                {
                    fixed ( byte* ptr = bytes )
                    {
                        int errorCode = XimeaAPI.xiGetParam( deviceHandle, parameterName, ptr, out size, ref type );
                        HandleError( errorCode );
                    }
                }

                return Encoding.ASCII.GetString( bytes, 0, size );
            }
        }

Usage Example

Пример #1
0
 /// <summary>
 /// Get camera's parameter as string value.
 /// </summary>
 ///
 /// <param name="parameterName">Parameter name to get from camera.</param>
 ///
 /// <returns>Returns string value of the requested parameter.</returns>
 ///
 /// <remarks><para><note>The call is redirected to <see cref="XimeaCamera.GetParamString"/>.</note></para></remarks>
 ///
 public string GetParamString(string parameterName)
 {
     return(camera.GetParamString(parameterName));
 }