title: Get Screen Scale Factor (100%; 125%)
body: <p>i'm using the Code from this question, to save screenshots into a bitmap:
  <a href="https://stackoverflow.com/questions/362986/capture-the-screen-into-a-bitmap">Capture the Screen into a Bitmap</a></p>
  
  <p>there is one Problem, the line <code>Screen.PrimaryScreen.Bounds.X</code> and <code>Screen.PrimaryScreen.Bounds.Y</code> return <code>1500,1000</code> but my screen is <code>3000,2000</code> scaled by <code>200%</code></p>
  
  <p>the result of this error is an Image with size 1500,1000 from the top left corner.</p>
  
  <p>how i worked around is by simply multiplying the dimensions by 2, but i dont want to hard code this scale factor, i somehow want to get it indevidually.</p>
  
  <p>i also tried this, but this registry entry simply doesnt exist on my computer: 
  <a href="https://stackoverflow.com/questions/32607468/get-scale-of-screen">Get scale of screen</a></p>
  
  <p><a href="http://glascake.com/stackoverflow/?dir=screen%20scale" rel="nofollow noreferrer">here the 2 screenshots, 1. what i want 2. what i get</a></p>
  
  <p>my current code:</p>
  
  <pre><code>            int boundsX = Screen.PrimaryScreen.Bounds.X * 2;
              int boundsY = Screen.PrimaryScreen.Bounds.Y * 2;
              Size screenSize = Screen.PrimaryScreen.Bounds.Size;
              screenSize = new Size(screenSize.Width * 2, screenSize.Height * 2);
  
              int boundsWidth = Screen.PrimaryScreen.Bounds.Width * 2;
              int boundsHeight = Screen.PrimaryScreen.Bounds.Height * 2;
  
              // Create a new bitmap.
              var bmpScreenshot = new Bitmap(boundsWidth,
                                  boundsHeight,
                                  PixelFormat.Format32bppArgb);
  
              // Create a graphics object from the bitmap.
              var gfxScreenshot = Graphics.FromImage(bmpScreenshot);
  
              // Take the screenshot from the upper left corner to the right bottom corner.
                  gfxScreenshot.CopyFromScreen(boundsX,
                                          boundsY,
                                          0,
                                          0,
                                          screenSize ,
                                          CopyPixelOperation.SourceCopy);
              bmpScreenshot.Save("Screenshot.png", ImageFormat.Png);
  </code></pre>