How do I take a screenshot from an UWP?











up vote
-1
down vote

favorite












I want to read my bluetooth le heart rate sensor output programmatically.




  • I tried c#, but it seems I need to use uwp.

  • I tried taking a screenshot in uwp - forbidden.

  • I tried executing an external program that takes a screenshot - forbidden.

  • I tried to send keystrokes Win - Printscreen to take a screenshot - forbidden.


How do I take a screenshot from an UWP?










share|improve this question
























  • This project might help you: github.com/jlennox/HeartRate
    – RQDQ
    Nov 7 at 19:26










  • @RQDQ Good suggestion.
    – Uli Loose
    Nov 7 at 19:56















up vote
-1
down vote

favorite












I want to read my bluetooth le heart rate sensor output programmatically.




  • I tried c#, but it seems I need to use uwp.

  • I tried taking a screenshot in uwp - forbidden.

  • I tried executing an external program that takes a screenshot - forbidden.

  • I tried to send keystrokes Win - Printscreen to take a screenshot - forbidden.


How do I take a screenshot from an UWP?










share|improve this question
























  • This project might help you: github.com/jlennox/HeartRate
    – RQDQ
    Nov 7 at 19:26










  • @RQDQ Good suggestion.
    – Uli Loose
    Nov 7 at 19:56













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I want to read my bluetooth le heart rate sensor output programmatically.




  • I tried c#, but it seems I need to use uwp.

  • I tried taking a screenshot in uwp - forbidden.

  • I tried executing an external program that takes a screenshot - forbidden.

  • I tried to send keystrokes Win - Printscreen to take a screenshot - forbidden.


How do I take a screenshot from an UWP?










share|improve this question















I want to read my bluetooth le heart rate sensor output programmatically.




  • I tried c#, but it seems I need to use uwp.

  • I tried taking a screenshot in uwp - forbidden.

  • I tried executing an external program that takes a screenshot - forbidden.

  • I tried to send keystrokes Win - Printscreen to take a screenshot - forbidden.


How do I take a screenshot from an UWP?







c# uwp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 0:33









Handbag Crab

1,245212




1,245212










asked Nov 7 at 19:23









Uli Loose

13




13












  • This project might help you: github.com/jlennox/HeartRate
    – RQDQ
    Nov 7 at 19:26










  • @RQDQ Good suggestion.
    – Uli Loose
    Nov 7 at 19:56


















  • This project might help you: github.com/jlennox/HeartRate
    – RQDQ
    Nov 7 at 19:26










  • @RQDQ Good suggestion.
    – Uli Loose
    Nov 7 at 19:56
















This project might help you: github.com/jlennox/HeartRate
– RQDQ
Nov 7 at 19:26




This project might help you: github.com/jlennox/HeartRate
– RQDQ
Nov 7 at 19:26












@RQDQ Good suggestion.
– Uli Loose
Nov 7 at 19:56




@RQDQ Good suggestion.
– Uli Loose
Nov 7 at 19:56












1 Answer
1






active

oldest

votes

















up vote
2
down vote













To your first point, most of the Bluetooth APIs are marked with the DualApiPartionAttribute - that means they can be called from UWP or a regular Win32/Winforms/WPF/.NET application. Visual Studio doesn't make this easy to reference for you yet. You need to first add the reference to the union Windows.WinMD for the version of windows you want to target, ie:




  • C:Program Files (x86)Windows Kits10UnionMetadata10.0.16299.0Windows.Winmd


and since many of apis are Async() you'll need to reference:




  • C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Runtime.WindowsRuntime.dll


Then the sample code looks essentially the same as UWP but called from your .NET app:




  • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing

  • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE


To your other questions about Screen capture, starting in Windows 1803, windows added a new Graphics Capture capability and apis. These classes are also marked DualApiPartitionAttribute so you can call them from either UWP or your Win32/.NET application. You can find more about them here:




  • https://docs.microsoft.com/en-us/uwp/api/windows.graphics.capture


Hope this helps,

-Adam






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53196399%2fhow-do-i-take-a-screenshot-from-an-uwp%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    To your first point, most of the Bluetooth APIs are marked with the DualApiPartionAttribute - that means they can be called from UWP or a regular Win32/Winforms/WPF/.NET application. Visual Studio doesn't make this easy to reference for you yet. You need to first add the reference to the union Windows.WinMD for the version of windows you want to target, ie:




    • C:Program Files (x86)Windows Kits10UnionMetadata10.0.16299.0Windows.Winmd


    and since many of apis are Async() you'll need to reference:




    • C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Runtime.WindowsRuntime.dll


    Then the sample code looks essentially the same as UWP but called from your .NET app:




    • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing

    • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE


    To your other questions about Screen capture, starting in Windows 1803, windows added a new Graphics Capture capability and apis. These classes are also marked DualApiPartitionAttribute so you can call them from either UWP or your Win32/.NET application. You can find more about them here:




    • https://docs.microsoft.com/en-us/uwp/api/windows.graphics.capture


    Hope this helps,

    -Adam






    share|improve this answer



























      up vote
      2
      down vote













      To your first point, most of the Bluetooth APIs are marked with the DualApiPartionAttribute - that means they can be called from UWP or a regular Win32/Winforms/WPF/.NET application. Visual Studio doesn't make this easy to reference for you yet. You need to first add the reference to the union Windows.WinMD for the version of windows you want to target, ie:




      • C:Program Files (x86)Windows Kits10UnionMetadata10.0.16299.0Windows.Winmd


      and since many of apis are Async() you'll need to reference:




      • C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Runtime.WindowsRuntime.dll


      Then the sample code looks essentially the same as UWP but called from your .NET app:




      • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing

      • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE


      To your other questions about Screen capture, starting in Windows 1803, windows added a new Graphics Capture capability and apis. These classes are also marked DualApiPartitionAttribute so you can call them from either UWP or your Win32/.NET application. You can find more about them here:




      • https://docs.microsoft.com/en-us/uwp/api/windows.graphics.capture


      Hope this helps,

      -Adam






      share|improve this answer

























        up vote
        2
        down vote










        up vote
        2
        down vote









        To your first point, most of the Bluetooth APIs are marked with the DualApiPartionAttribute - that means they can be called from UWP or a regular Win32/Winforms/WPF/.NET application. Visual Studio doesn't make this easy to reference for you yet. You need to first add the reference to the union Windows.WinMD for the version of windows you want to target, ie:




        • C:Program Files (x86)Windows Kits10UnionMetadata10.0.16299.0Windows.Winmd


        and since many of apis are Async() you'll need to reference:




        • C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Runtime.WindowsRuntime.dll


        Then the sample code looks essentially the same as UWP but called from your .NET app:




        • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing

        • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE


        To your other questions about Screen capture, starting in Windows 1803, windows added a new Graphics Capture capability and apis. These classes are also marked DualApiPartitionAttribute so you can call them from either UWP or your Win32/.NET application. You can find more about them here:




        • https://docs.microsoft.com/en-us/uwp/api/windows.graphics.capture


        Hope this helps,

        -Adam






        share|improve this answer














        To your first point, most of the Bluetooth APIs are marked with the DualApiPartionAttribute - that means they can be called from UWP or a regular Win32/Winforms/WPF/.NET application. Visual Studio doesn't make this easy to reference for you yet. You need to first add the reference to the union Windows.WinMD for the version of windows you want to target, ie:




        • C:Program Files (x86)Windows Kits10UnionMetadata10.0.16299.0Windows.Winmd


        and since many of apis are Async() you'll need to reference:




        • C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Runtime.WindowsRuntime.dll


        Then the sample code looks essentially the same as UWP but called from your .NET app:




        • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing

        • https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE


        To your other questions about Screen capture, starting in Windows 1803, windows added a new Graphics Capture capability and apis. These classes are also marked DualApiPartitionAttribute so you can call them from either UWP or your Win32/.NET application. You can find more about them here:




        • https://docs.microsoft.com/en-us/uwp/api/windows.graphics.capture


        Hope this helps,

        -Adam







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 8 at 0:27

























        answered Nov 8 at 0:17









        Adam Braden - MSFT

        665




        665






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53196399%2fhow-do-i-take-a-screenshot-from-an-uwp%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Xamarin.form Move up view when keyboard appear

            Post-Redirect-Get with Spring WebFlux and Thymeleaf

            Anylogic : not able to use stopDelay()