locked
how to screen capture in win 10? RRS feed

Answers

  • Hello,

    On Win 8 we do not have UWP app, we only have Windows 8 Store app.

    And as you may find from doc:

    "The ScreenCapture feature is only supported for mobile devices running Windows Phone 8.1. This API is not supported on Windows 10."

    To capture the element in your app actually you can use rendertargetbitmap to render your elements.

    Best regards,

    Barry


    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.

    • Proposed as answer by Barry Wang Friday, June 2, 2017 2:10 AM
    • Marked as answer by BillQu0002 Monday, June 5, 2017 11:56 AM
    Wednesday, May 31, 2017 9:30 AM

All replies

  • Hi BillQu0002,

    Thank you for posting here.

    For the use of Windows.Media.Capture.ScreenCapture, you could download the source file from code project.

    https://www.codeproject.com/Articles/5051/Various-methods-for-capturing-the-screen

    Here is a simple way for your reference.

    class Program
        {
            // a method to pause the console. 
            // not a part of this project! 
            public static void pause()
            {
                Console.Read();
            }
    
            static void Main(string[] args)
            {
                // Start the process... 
                Console.WriteLine("Initializing the variables...");
                Console.WriteLine();
                Bitmap memoryImage;
                memoryImage = new Bitmap(1200, 900);
                Size s = new Size(memoryImage.Width, memoryImage.Height);
    
                // Create graphics 
                Console.WriteLine("Creating Graphics...");
                Console.WriteLine();
                Graphics memoryGraphics = Graphics.FromImage(memoryImage);
    
                // Copy data from screen 
                Console.WriteLine("Copying data from screen...");
                Console.WriteLine();
                memoryGraphics.CopyFromScreen(0, 0, 0, 0, s);
    
                //That's it! Save the image in the directory and this will work like charm. 
                string str = "";
                try
                {
                    str = string.Format(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
                          @"\Screenshot.png");
                }
                catch (Exception er)
                {
                    Console.WriteLine("Sorry, there was an error: " + er.Message);
                    Console.WriteLine();
                }
    
                // Save it! 
                Console.WriteLine("Saving the image...");
                memoryImage.Save(str);
    
                // Write the message, 
                Console.WriteLine("Picture has been saved...");
                Console.WriteLine();
                // Pause the program to show the message. 
                Program.pause();
            }
        }

    I hope this would be helpful.

    Best Regards,

    Wendy


    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.

    Wednesday, May 31, 2017 6:31 AM
  • Think you, but I am a uwp app.

    can you way work at uwp app?

    And I want to capture and record screen video and audio?

    How should I do?

    Wednesday, May 31, 2017 8:21 AM
  • Think you, but I am a uwp app.

    can you way work at uwp app?


    MSDN says  "Updated for UWP apps on Windows 10"

    in the page Basic photo, video, and audio capture with MediaCapture

    Wednesday, May 31, 2017 8:36 AM
  • Hello,

    On Win 8 we do not have UWP app, we only have Windows 8 Store app.

    And as you may find from doc:

    "The ScreenCapture feature is only supported for mobile devices running Windows Phone 8.1. This API is not supported on Windows 10."

    To capture the element in your app actually you can use rendertargetbitmap to render your elements.

    Best regards,

    Barry


    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.

    • Proposed as answer by Barry Wang Friday, June 2, 2017 2:10 AM
    • Marked as answer by BillQu0002 Monday, June 5, 2017 11:56 AM
    Wednesday, May 31, 2017 9:30 AM
  • Hi BillQu0002,

    Thank you for feedback.

    I will move it to UWP forum for suitable support.

    Best Regards,

    Wendy


    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.

    Wednesday, May 31, 2017 9:45 AM