Esempio n. 1
0
        private void SetAspectRatio(ImageAspectRatio _aspectRatio, Size _size)
        {
            m_AspectRatio = _aspectRatio;

            if (m_FrameGrabber.IsConnected)
            {
                int newHeight;

                switch (_aspectRatio)
                {
                case ImageAspectRatio.Auto:
                default:
                    newHeight = _size.Height;
                    break;

                case ImageAspectRatio.Force43:
                    newHeight = (_size.Width / 4) * 3;
                    break;

                case ImageAspectRatio.Force169:
                    newHeight = (_size.Width / 16) * 9;
                    break;
                }

                m_ImageSize = new Size(_size.Width, newHeight);
                transformDisplay.SetOriginalSize(m_ImageSize);
                transformRecord.SetOriginalSize(m_ImageSize);
                m_Container.DoInitDecodingSize();
                m_Metadata.ImageSize = m_ImageSize;
                m_FrameBuffer.UpdateFrameSize(m_ImageSize);
            }
        }
Esempio n. 2
0
        private void SetAspectRatio(VideoFiles.AspectRatio _aspectRatio, Size _size)
        {
            m_AspectRatio = _aspectRatio;

            if (m_FrameGrabber.IsConnected)
            {
                int newHeight;

                switch (_aspectRatio)
                {
                case AspectRatio.AutoDetect:
                default:
                    newHeight = _size.Height;
                    break;

                case AspectRatio.Force43:
                    newHeight = (_size.Width / 4) * 3;
                    break;

                case AspectRatio.Force169:
                    newHeight = (_size.Width / 16) * 9;
                    break;
                }

                m_ImageSize = new Size(_size.Width, newHeight);
                m_CoordinateSystem.SetOriginalSize(m_ImageSize);
                m_Container.DoInitDecodingSize();
            }
        }