Reputation: 11
I'm making a UWP app using MixedReality-WebRTC.
Is there a way to get the current screen real-time, not a webcam?
Upvotes: 1
Views: 924
Reputation: 32785
Is there a way to get the current screen real-time
Sure, you could use GraphicsCapturePicker
to pick window that you want to capture, and use screen capture api the get real time frame with FrameArrived
event.
_framePool.FrameArrived += (s, a) =>
{
// The FrameArrived event fires for every frame on the thread that
// created the Direct3D11CaptureFramePool. This means we don't have to
// do a null-check here, as we know we're the only one
// dequeueing frames in our application.
// NOTE: Disposing the frame retires it and returns
// the buffer to the pool.
using (var frame = _framePool.TryGetNextFrame())
{
// We'll define this method later in the document.
ProcessFrame(frame);
}
};
And here is official document that you could refer.
Upvotes: 1