Пишу программу(c#) для создания скриншотов по типу windows ножниц, при разрешении экрана 1280х720 все работает, но при разрешении 1920x1080 скрин экрана делается в каком-то левом месте... Хелп
Bitmap bmp = new Bitmap(___Form.Width, ___Form.Height); using (Graphics g = Graphics.FromImage(bmp)) { g.CopyFromScreen(___Form.Location.X, ___Form.Location.Y, 0, 0, new Size(___Form.Width, ___Form.Height)); } pictureBox1.Image = bmp; Код Bitmap bmp = new Bitmap(___Form.Width, ___Form.Height); using (Graphics g = Graphics.FromImage(bmp)) { g.CopyFromScreen(___Form.Location.X, ___Form.Location.Y, 0, 0, new Size(___Form.Width, ___Form.Height)); } pictureBox1.Image = bmp; ___Form - служит выделением
Попробуй из этого что-то namespace Test { using System; using System.Drawing; using System.Windows.Forms; public class ScreenShot { public static void Inizialize_Screen(string path) { try { using (var bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)) { using (var g = Graphics.FromImage(bmp)) { try { g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size); bmp.Save(path); } catch { } } } } catch (Exception) { } } } } Код namespace Test { using System; using System.Drawing; using System.Windows.Forms; public class ScreenShot { public static void Inizialize_Screen(string path) { try { using (var bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)) { using (var g = Graphics.FromImage(bmp)) { try { g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size); bmp.Save(path); } catch { } } } } catch (Exception) { } } } }