1

Hi I have a function in c# to get a screenshot of poor quality so that the image does not weigh much, I have it all figured out but the problem is that the screenshot does not see the mouse cursor.

the code is this:

    int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
    int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
    Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
    Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
    gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
    bmpScreenShot.Save("test.jpg", ImageFormat.Jpeg);

as I solve this problem?

1
  • AFAIK, you'll have to add it yourself. Maybe this question can help. Commented May 30, 2014 at 20:16

1 Answer 1

5

You need to draw the cursor on the image on your own. The system will not capture it since it is drawn in low-level driver.

To draw it at first you need to get cursor image itself from system's mouse settings as a cur file. Also you will need a current cursor type (hand, resize, etc) and its position at the moment of taking a screenshot.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.