Skip to content

Commit eae83af

Browse files
committed
fix sharing a non-primary screen
#48
1 parent df2809c commit eae83af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ScreenTask/frmMain.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,13 @@ private void TakeScreenshot(bool captureMouse)
263263
bmp = null;
264264
return;
265265
}
266-
Rectangle bounds = Screen.GetBounds(Point.Empty);
266+
267+
Rectangle bounds = Screen.AllScreens[comboScreens.SelectedIndex].Bounds;
267268
using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
268269
{
269270
using (Graphics g = Graphics.FromImage(bitmap))
270271
{
271-
g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
272+
g.CopyFromScreen(new Point(bounds.X,bounds.Y), Point.Empty, bounds.Size);
272273
}
273274
rwl.AcquireWriterLock(Timeout.Infinite);
274275
bitmap.Save(Application.StartupPath + "/WebServer" + "/ScreenTask.jpg", ImageFormat.Jpeg);

0 commit comments

Comments
 (0)