I'm little bit confusing with taking screenshot of the current window programmatically and save it in the phone's gallery. There are no any tutorials for Windows Phone 8.1.
private async Task<RenderTargetBitmap>CreateBitmapFromElement(FrameworkElement uielement)try{
var renderTargetBitmap = new RenderTargetBitmap();
await renderTargetBitmap.RenderAsync(uielement);
return renderTargetBitmap;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex);
}
return null;}
I have this code. How can I save this to the media library?