0

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • I'm marking is as a duplicate of [this question](http://stackoverflow.com/questions/20280120/how-to-programmatically-take-a-screenshot-on-window). Anyway, Microsoft Virtual Academy offers a good deal of tutorials about Windows Phone 8.1 development. Take a look [here](https://mva.microsoft.com/en-us/training-courses/windows-phone-8-1-development-for-absolute-beginners-8375?l=7j1Mg9Hz_8804984382) – Paolo Tagliapietra Feb 10 '16 at 19:22
  • Possible duplicate of [How to programmatically take a screenshot on windows phone?](https://stackoverflow.com/questions/20280120/how-to-programmatically-take-a-screenshot-on-windows-phone) – David Makogon Feb 09 '19 at 17:57

1 Answers1

-2

Press the power button & the volume button together at the same time.

kernanb
  • 566
  • 2
  • 6
  • 19
  • Don't know of any way to do this programmatically. You could save an image that is in the foreground of your app, but not the entire screen. – kernanb Feb 10 '16 at 06:12