How can I convert a RenderTargetBitmap to BitmapImage in C# XAML, Windows 8.1?
I tried
// rendered is the RenderTargetBitmap
BitmapImage img = new BitmapImage();
InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream();
await randomAccessStream.WriteAsync(await rendered.GetPixelsAsync());
randomAccessStream.Seek(0);
await img.SetSourceAsync(randomAccessStream);
But it always gives error at
img.SetSourceAsync(randomAccessStream);
There are many ways in WPF but in WinRT? How can I do that ?
Thanks a lot!