locked
How take a max resolution picture from a Surface? pro grammatically? RRS feed

  • Question

  • The situation is I have built a WPF/Prism.Unity/MVVM program using the .NET Framework and intended to run on Microsoft Surface computers. These devices have two cameras. It is desired that the user be able to use the front camera to take a picture. While setting up for the picture the user must be able to monitor what the front camera is seeing. I've accomplished most of this with the exception of a max resolution camera snap using IGraphBuilder technology. IGraphBuilder supports enumeration of available cameras, camera selection and image stream and capture of a free running video feed. The problem is, images are captured at video resolution (1080p) and what the client wants is to capture an image at the best resolution available. I don't see how to do that in the IGraphBuilder world. Does anyone know how to do an image capture at max available resolution on a Surface?

    Richard Lewis Haggard


    Saturday, April 11, 2020 10:16 PM

All replies

  • Hi,

    Thanks for posting here.

    You can try to use IAMStreamConfig.GetStreamCaps method on the output (capture) pin of the filter.

    Exposing Capture and Compression Formats and Video Capabilities

    And you can query the capabilities respectively. Note that an enumerated capability obtained this way might be not a specific resolution, but a range of supported resolutions for specific pixel format instead.

    Then use SetFormat to set the max format.

    Or use OpenCV just to set to a very high resolution (above the capabilities of any usual capture device):

    https://stackoverflow.com/a/31464688/10611792

    Best Regards,

    Drake


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 13, 2020 2:54 AM