I am trying to save a screenshot of the second monitor which has a different resolution/DPI than the primary monitor (I am not totally familiar with these terminologies so I am not very sure), this is the code that I am using:
public void SaveScreenshot(Screen screen)
{
using (Bitmap bitmap = new Bitmap(screen.Bounds.Width, screen.Bounds.Height))
{
using (Graphics g = Graphics.FromImage(bitmap))
{
int x = screen.Bounds.Left;
int y = screen.Bounds.Top;
int w = screen.Bounds.Width;
int h = screen.Bounds.Height;
g.CopyFromScreen(x, y, 0, 0, new Size(w, h));
}
bitmap.Save("screenshot.bmp");
}
}
The problem is that the resulting image doesn't have the whole picture, instead, it has a larger and cropped one.
I don't know what I'm doing wrong.


I managed to solve it by using EnumDisplaySettings:
and editing the original code to
Update:
As @Jimi suggested, eventually I had to enable per-monitor dpi-awareness to maintain the quality of the image when putting it on the Form
app.manifest