Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a Win8 Metro-JS app take a screenshot of itself?

I'd like to use a screenshot of the current state of my game as the panel that helps users figure out which of their save states they're looking at. I can snap the data and generate it, but that's a lot of hassle, and if there's some way to just say "I'd like a screenshot of myself," that'd save me a huge amount of time.

I have no interest in screenshots of other applications.

Can a Metro JS (or Modern UI, I guess it's called now) application self-screenshot somehow?

like image 273
John Haugeland Avatar asked Nov 13 '22 18:11

John Haugeland


1 Answers

No, there is no official way to take a screenshot of yourself. I tried to call into SendKeys locally as a hack to see if you could send the PrintScreen key to the Window and then pull the result off the clipboard. If there would be anyway to do this, it would be that (though I haven't had luck as I mention). To call that from a JS app, you would need to have the code in C# or C++ and then expose it as a Windows Runtime component that is referenced and called by the JS code.

If there was going to be any workaround without duplicating the rendering of data yourself, I'd imagine that would be it.

like image 75
Jason Olson Avatar answered Nov 15 '22 06:11

Jason Olson