Hi all.
I have a task of displaying the camera's capture in WinForms application.
First of all i tried to save raw data to a file
- Code: Select all
public void VideoInputFrameArrived(IDeckLinkVideoInputFrame video, IDeckLinkAudioInputPacket audio)
{
IntPtr pData;
video.GetBytes(out pData );
byte[] buffer = new byte[1920 * 1080 * 4];
System.Runtime.InteropServices.Marshal.Copy( pData, buffer, 0, buffer.Length );
System.IO.FileStream file = new System.IO.FileStream("frame" + frameCount + ".raw", System.IO.FileMode.Create);
file.Write(buffer, 0, buffer.Length);
file.Close();
but I always get all the pixels are black. Actually as far as pixelformat I have setted is 32bppABGR,
I get FF 00 00 00 for each pixel.
Could somebody tell me where is my mistake?
And one more thing: could somebody provide me a shortest way to display raw data in WinForm Window (I am new in WinForms)
Thanks a lot