2

One of my forms takes screenshot of desktop and uses it as form background for drawing on it. But when the Windows setting "Desktop/Screen resolution/Make text and other items larger or smaller" is greater than 100% the Screen.Bounds is smaller then Image.Size. So the background image is bigger than form. Streching the screenshot image couses blurring. So what is the solution for proper size screenshot? Preventing Windows from AutoScaling my form or another way of screenshot?

        SendKeys.SendWait("{PRTSC}");
        Image img= Clipboard.GetImage();
        this.BackgroundImage = img;

        Debug.Print("Img.Size=" + img.Size.ToString());
        Debug.Print("Screen.Size=" + Screen.PrimaryScreen.Bounds);
YAts
  • 21
  • 2
  • 1
    It is *not* getting auto-scaling that is the problem. You need to [tell Windows](http://stackoverflow.com/a/13228495/17034) to stop trying to be helpful. – Hans Passant Jul 12 '16 at 13:53
  • 1
    If I were You, the first thing what I would do is setting window AutoSize property to 'false'. Next step would be setting another two properties of the same window: MaximumSize and MinimumSize on the same values. – Maciej S. Jul 12 '16 at 14:01
  • Maciej , I tested them. Not solved. Thanks for reply. – YAts Jul 12 '16 at 14:59
  • Hans manifest file also doesn't solved. – YAts Jul 12 '16 at 15:59

0 Answers0