示例#1
0
        //Sync methods
        /// <summary>
        /// the relevant Register of the Registerlist 0x12 will be masked and the _ouPutResolutionFormat is set.
        /// Note that this function do not get refreshed data from the hardware camera. It is just an internal object update class.
        /// To be sure to get the latest status of the camera you need to read the 0x12 register from the camera
        /// </summary>
        public void UpdateOutputFormat()
        {
            Byte ColorFormat = this.getRegisterValue(0x12).getByte();

            ColorFormat = (Byte)(ColorFormat & (Byte)0x38);
            switch (ColorFormat)
            {
            case 0:
                _outPutResolutionFormat = EnumResolutionFormat.VGA;
                _picture.ResolutionX    = 640;
                _picture.ResolutionY    = 480;
                break;

            //TODO: add other resolutions
            case 8:
                _outPutResolutionFormat = EnumResolutionFormat.QCIF;
                _picture.ResolutionX    = 176;
                _picture.ResolutionY    = 144;
                break;

            case 16:
                _outPutResolutionFormat = EnumResolutionFormat.QVGA;
                _picture.ResolutionX    = 313;
                _picture.ResolutionY    = 240;
                break;

            case 32:
                _outPutResolutionFormat = EnumResolutionFormat.CIF;
                _picture.ResolutionX    = 352;
                _picture.ResolutionY    = 288;
                break;

            default:
                _outPutResolutionFormat = EnumResolutionFormat.NotSelected;
                break;
            }
            PictureFormatEventArgs eArgs = new PictureFormatEventArgs(_picture.ResolutionX, _picture.ResolutionY, _picture.BytesPerPixel);

            OnPictureFormatChanged(eArgs);
        }
示例#2
0
 /// <summary>
 /// With this function, the resolutionformat can be set manually without reading the registers.
 /// Caution! This operations should be performed after the registers are read, because the
 /// register read will overwrite it.
 /// </summary>
 /// <param name="_setResolutionFormat"></param>
 public void SetResolutionFormatManually(EnumResolutionFormat _setResolutionFormat)
 {
     _outPutResolutionFormat = _setResolutionFormat;
 }