'How to convert Direct3D11CaptureFrame into pixel data array?

I'm trying to convert Direct3D11CaptureFrame from Windows.Graphics.Capture into PPM image file if save screenshot is pressed. Need to get Pixel colour data from Direct3D11CaptureFrame, Is there any way to do this? I have implemented this in the old bitBlt method but trying to covert code to graphics capture.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source