void History() { if (WorkingImg != null) { if (HistoryImg.Count < 20) { HistoryImg.Add(WorkingImg.Clone()); } else { HistoryImg.RemoveAt(0); History(); } } }
void Back() { if (HistoryImg.Count > 1) { WorkingImg = HistoryImg[HistoryImg.Count - 2].Clone(); HistoryImg.RemoveAt(HistoryImg.Count - 1); imageBox1.Image = WorkingImg; var num = rtxLog.Lines.Length - 2; rtxLog.Lines = rtxLog.Lines.Take(num).ToArray(); rtxLog.AppendText(Environment.NewLine); } else if (HistoryImg.Count == 1) { WorkingImg = HistoryImg[0].Clone(); HistoryImg.RemoveAt(0); imageBox1.Image = WorkingImg; rtxLog.AppendText(Environment.NewLine); } }