private void pictureBox1_MouseMove(object sender, MouseEventArgs e) { toolStripStatusLabelCursorPosition.Text = $"X: {e.X} Y: {e.Y}"; if (e.Button == MouseButtons.Left) { punktyRobocze.Add(e.Location); Figura figura = null; pictureBoxPodglad.Image = new Bitmap(pictureBoxRamka.Image); gp = Graphics.FromImage(pictureBoxPodglad.Image); if (radioButtonProsta.Checked) { figura = new Linia(buttonKolorLinii.BackColor, (int)numericUpDownGruboscLinii.Value, punktyRobocze.First(), punktyRobocze.Last()); } else if (radioButtonKrzywa.Checked) { figura = new Krzywa(buttonKolorLinii.BackColor, (int)numericUpDownGruboscLinii.Value, punktyRobocze); } else if (radioButtonProstokat.Checked) { figura = new Prostokat(buttonKolorLinii.BackColor, (int)numericUpDownGruboscLinii.Value, buttonKolorWypelnienia.BackColor, punktyRobocze.First(), punktyRobocze.Last()); } else if (radioButtonElipsa.Checked) { figura = new Elipsa(buttonKolorLinii.BackColor, (int)numericUpDownGruboscLinii.Value, buttonKolorWypelnienia.BackColor, punktyRobocze.First(), punktyRobocze.Last()); } else if (radioButtonGumka.Checked) { figura = new Gumka(Color.White, (int)numericUpDownGruboscLinii.Value, punktyRobocze); } else if (radioButtonSelect.Checked) { figura = new Zaznaczenie(Color.Red, (int)numericUpDownGruboscLinii.Value, punktyRobocze.First(), punktyRobocze.Last()); } if (figura != null) { figura.Rysuj(gp); pictureBoxPodglad.Refresh(); } } }
internal void Dodaj(Figura f) { figury.Add(f); }