IMAQ.CameraController.StoreImageData C# (CSharp) Method

StoreImageData() public method

public StoreImageData ( string savePath, byte imageData ) : void
savePath string
imageData byte
return void
        public void StoreImageData(string savePath, byte[,] imageData)
        {
            int width = imageData.GetLength(1);
            int height = imageData.GetLength(0);
            byte[] pixels = new byte[width * height];
            for (int j = 0; j < height; j++)
            {
                for (int i = 0; i < width; i++)
                {
                    pixels[(width * j) + i] = imageData[j, i];
                }
            }

            FileStream stream = new FileStream(savePath + ".dat", FileMode.Create);
            stream.Write(pixels,0,width*height);
            stream.Dispose();
        }