p0 = CVision_WPFGetHead0();//get head of the bmp through dll
n0 = CVision_WPFGetLength0();//get length through dll
ImageBrush ImageOne = new ImageBrush();
Marshal.Copy(p0,ima0 , 0, n0);//copy bmp data from unmanaged
System.IO.MemoryStream ms = new System.IO.MemoryStream(ima0, 0, n0);
BitmapImage src0 = new BitmapImage();
src0.BeginInit();
src0.StreamSource = ms;
src0.EndInit();
ImageOne.ImageSource = src0;
ImageOne.Stretch = Stretch.Fill;
CameraGrid1.Background = ImageOne;