I need to save a video as an image in silverlight, for my new webpage functionality, at http://www.game4tress.com/ecardsender.aspx. Now, this would be easy in WPF, but seems that silverlight can't access the RenderTargetBitmap and BitmapEncoder. I was able to discover that RenderTargetBitmap can be replaced with WriteableBitmap, but i can't replace BitmapEncoder.
If the function was made in WPF, i would use this code:
myCanvas.HorizontalAlignment=HorizontalAlignment.Stretch;
int Height=(int)myCanvas.ActualHeight;
int Width=(int)myCanvas.ActualWidth;
RenderTargetBitmap bmp=new RenderTargetBitmap(Width,Height,96,96,PixelFormats.Pbgra32);
bmp.Render(myCanvas);
BitmapEncoder encoder=new JpegBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bmp));
using(System.IO.Stream stm=System.IO.File.Create("C:\\Temp.jpeg"))
{
encoder.Save(stm);
stm.Dispose();
}
I can't seem able to find an equivalent way out in Silverlight. Can you, please help?
My thanks in advanced