Saving a render as byte[]

Jun 28, 2013 at 1:20 PM
Hello all!

I have been using this code to save snapshots:

RenderTargetBitmap bmp = new RenderTargetBitmap(1744, 820, 96, 96, PixelFormats.Pbgra32);
        bmp.Render(videoElement);
        BitmapEncoder encoder = new JpegBitmapEncoder();
        encoder.Frames.Add(BitmapFrame.Create(bmp));
        string now = DateTime.Now.Year + "" + DateTime.Now.Month + "" + DateTime.Now.Day + "" + DateTime.Now.Hour + "" + DateTime.Now.Minute + "" + DateTime.Now.Second;
        string filename = now + "pic.jpg";
        FileStream fstream = new FileStream(filename, FileMode.Open);
        encoder.Save(fstream);
        fstream.Close();
but I need something different, i need to get the byte[] data of the pictures, i was wondering if anyone could help me?

thanks!