AnimatGuiCtrls.Video.VideoStream.SetFormat C# (CSharp) Method

SetFormat() private method

Apply a format to a new stream
The format must be set before the first frame can be written, and it cannot be changed later.
private SetFormat ( IntPtr aviStream ) : void
aviStream System.IntPtr The IAVISTREAM
return void
        private void SetFormat(IntPtr aviStream)
        {
            Avi.BITMAPINFOHEADER bi = new Avi.BITMAPINFOHEADER();
            bi.biSize      = Marshal.SizeOf(bi);
            bi.biWidth     = width;
            bi.biHeight    = height;
            bi.biPlanes    = 1;
            bi.biBitCount  = countBitsPerPixel;
            bi.biSizeImage = frameSize;

            int result = Avi.AVIStreamSetFormat(aviStream, 0, ref bi, bi.biSize);
            if(result != 0){ throw new Exception("Error in VideoStreamSetFormat: "+result.ToString()); }
        }