Beispiel #1
0
 private Avi.BITMAPINFOHEADER GetImageFormat()
 {
     Avi.BITMAPINFOHEADER format = new Avi.BITMAPINFOHEADER();
     format.biSize        = Marshal.SizeOf(format);
     format.biPlanes      = 1;
     format.biBitCount    = 24;
     format.biCompression = 0;                 //RGB
     format.biHeight      = Height;
     format.biWidth       = Width;
     format.biSizeImage   = FrameSize;
     return(format);
 }
Beispiel #2
0
        private IEnumerable <Avi.Codec> GetAvailiableCodecs()
        {
            Avi.BITMAPINFOHEADER header = GetInputFormat();

            foreach (Avi.Codec codec in Avi.Codec.GetInstalledCodecs())
            {
                if (codec.CanCompress(header))
                {
                    yield return(codec);
                }
            }
        }
Beispiel #3
0
 private static Avi.BITMAPINFOHEADER GetInputFormat()
 {
     Avi.BITMAPINFOHEADER format = new Avi.BITMAPINFOHEADER();
     format.biSize        = Marshal.SizeOf(format);
     format.biPlanes      = 1;
     format.biBitCount    = 24;
     format.biCompression = 0;          //RGB
     format.biHeight      = 512;        //use 512x512 just to get the available codecs.
     format.biWidth       = 512;
     format.biSizeImage   = 3 * format.biWidth * format.biHeight;
     return(format);
 }
Beispiel #4
0
            private void SetFormat(IntPtr aviStream)
            {
                Avi.BITMAPINFOHEADER info = GetImageFormat();

                int result = Avi.AVIStreamSetFormat(aviStream, 0, ref info, info.biSize);

                if (result != 0)
                {
                    throw new VideoStreamWriterException("Avi stream format could not be set.");
                }

                GC.KeepAlive(info);
            }
Beispiel #5
0
			private Avi.BITMAPINFOHEADER GetImageFormat()
			{
				Avi.BITMAPINFOHEADER format = new Avi.BITMAPINFOHEADER();
				format.biSize = Marshal.SizeOf(format);
				format.biPlanes = 1;
				format.biBitCount = 24;
				format.biCompression = 0; //RGB
				format.biHeight = Height;
				format.biWidth = Width;
				format.biSizeImage = FrameSize;
				return format;
			}