Код: Выделить всё
public static Image Preview(int startX, int startY, int width, int height)
{
Rectangle bounds = new Rectangle(startX, startY, width, height);
using (Bitmap scr = new Bitmap(bounds.Width, bounds.Height))
{
using (Graphics g = Graphics.FromImage(scr))
{
g.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size);
}
return scr;
}
}
Код: Выделить всё
MyPictureBox.Image = Preview(0, 0, 1080, 720);
System.ArgumentException: «Параметр недействителен».
В чем проблема?
(Прошу прощения за грамматические ошибки, английский не для меня родной)
Подробнее здесь: https://stackoverflow.com/questions/632 ... ox-c-sharp
Мобильная версия