//Allocate array
Image frame = new Image();
frame.Stretch = Stretch.None;
colorBitmap = new WriteableBitmap(sensor.ColorStream.FrameWidth, sensor.ColorStream.FrameHeight, 96.0, 96.0, PixelFormats.Bgr32, null);
//Write the pixel data into bitmap
do
{
colorBitmap.WritePixels(new Int32Rect(0...