using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Windows.Forms; private readonly Pen pen1 = new Pen(Color.Black); private Graphics graphics; private bool isDrawing = false; public int x_MD_1, y_MD_1; private void Form1_Load(object sender, EventArgs e) { try { radioButton1.Checked = true; StartNewDrawing(); } catch (Exception Исключение) { // Отчет о других ошибках: MessageBox.Show(Исключение.Message, "ошибка", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } private void StartNewDrawing() { Bitmap bm = new Bitmap(pictureBox1.ClientRectangle.Width, pictureBox1.ClientRectangle.Height); graphics = Graphics.FromImage(bm); graphics.Clear(BackColor);