private void ButtonLoad_Click(object sender, EventArgs e) { if (open.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; sprite = Sprite.Load(open.FileName); //("sprite.xml") graph.Clear(); RefreshBitmap(); }
public FormSprite() { InitializeComponent(); graph = new Graph(picture.Width, picture.Height);//высоту и ширину берем прямо из элемента picturebox1 окна программы. sprite = new Sprite(); picture.Image = graph.bmp; currLine.x1 = -1; }
//Метод для рисования всех линий сразу. public void Draw(Sprite sprite) { foreach (MyLine line in sprite.lines) Draw(line); }