/// <summary> /// Set the Mediatype from a bitmap /// </summary> override public void SetMediaType(IGenericSampleConfig psc) { BitmapInfoHeader bmi = new BitmapInfoHeader(); // Make sure we have an image to get the data from if (m_bmp == null) { int i; IntPtr ip = IntPtr.Zero; GetImage(0, ip, 0, out i); } // Build a BitmapInfo struct using the parms from the file bmi.Size = Marshal.SizeOf(typeof(BitmapInfoHeader)); bmi.Width = m_bmd.Width; bmi.Height = m_bmd.Height * -1; bmi.Planes = 1; bmi.BitCount = 32; bmi.Compression = 0; bmi.ImageSize = (bmi.BitCount / 8) * bmi.Width * bmi.Height; bmi.XPelsPerMeter = 0; bmi.YPelsPerMeter = 0; bmi.ClrUsed = 0; bmi.ClrImportant = 0; int hr = psc.SetMediaTypeFromBitmap(bmi, m_FPS); DsError.ThrowExceptionForHR(hr); }
/// <summary> /// Set the media type on the IGenericSampleConfig /// </summary> override public void SetMediaType(IGenericSampleConfig psc) { BitmapInfoHeader bmi = new BitmapInfoHeader(); // Build a BitmapInfo struct using the parms from the file bmi.Size = Marshal.SizeOf(typeof(BitmapInfoHeader)); bmi.Width = WIDTH; bmi.Height = HEIGHT * -1; bmi.Planes = 1; bmi.BitCount = BPP; bmi.Compression = 0; bmi.ImageSize = (bmi.BitCount / 8) * bmi.Width * bmi.Height; bmi.XPelsPerMeter = 0; bmi.YPelsPerMeter = 0; bmi.ClrUsed = 0; bmi.ClrImportant = 0; int hr = psc.SetMediaTypeFromBitmap(bmi, m_FPS); DsError.ThrowExceptionForHR(hr); }
override public void SetMediaType(IGenericSampleConfig psc) { BitmapInfoHeader bmi = new BitmapInfoHeader(); bmi.Size = Marshal.SizeOf(typeof(BitmapInfoHeader)); bmi.Width = reader.Header.VideoSize.Width; bmi.Height = reader.Header.VideoSize.Height; bmi.Planes = 1; bmi.BitCount = 24; bmi.Compression = 0; bmi.ImageSize = (bmi.BitCount / 8) * bmi.Width * bmi.Height; bmi.XPelsPerMeter = 0; bmi.YPelsPerMeter = 0; bmi.ClrUsed = 0; bmi.ClrImportant = 0; int hr = psc.SetMediaTypeFromBitmap(bmi, 0); buffer = new byte[reader.Header.FrameSize]; demosaicBuffer = new byte[reader.Header.FrameSize * 3]; DsError.ThrowExceptionForHR(hr); }
/// <summary> /// Set the media type on the IGenericSampleConfig /// </summary> public override void SetMediaType(IGenericSampleConfig psc) { BitmapInfoHeader bmi = new BitmapInfoHeader(); // Build a BitmapInfo struct using the parms from the file bmi.Size = Marshal.SizeOf(typeof(BitmapInfoHeader)); bmi.Width = WIDTH; bmi.Height = HEIGHT * -1; bmi.Planes = 1; bmi.BitCount = BPP; bmi.Compression = 0; bmi.ImageSize = (bmi.BitCount / 8) * bmi.Width * bmi.Height; bmi.XPelsPerMeter = 0; bmi.YPelsPerMeter = 0; bmi.ClrUsed = 0; bmi.ClrImportant = 0; int hr = psc.SetMediaTypeFromBitmap(bmi, m_FPS); DsError.ThrowExceptionForHR(hr); }
/// <summary> /// Set the Mediatype from a bitmap /// </summary> public override void SetMediaType(IGenericSampleConfig psc) { BitmapInfoHeader bmi = new BitmapInfoHeader(); // Make sure we have an image to get the data from if (m_bmp == null) { int i; IntPtr ip = IntPtr.Zero; GetImage(0, ip, 0, out i); } // Build a BitmapInfo struct using the parms from the file bmi.Size = Marshal.SizeOf(typeof(BitmapInfoHeader)); bmi.Width = m_bmd.Width; bmi.Height = m_bmd.Height * -1; bmi.Planes = 1; bmi.BitCount = 32; bmi.Compression = 0; bmi.ImageSize = (bmi.BitCount / 8) * bmi.Width * bmi.Height; bmi.XPelsPerMeter = 0; bmi.YPelsPerMeter = 0; bmi.ClrUsed = 0; bmi.ClrImportant = 0; int hr = psc.SetMediaTypeFromBitmap(bmi, m_FPS); DsError.ThrowExceptionForHR(hr); }