public void EditScheme(ColorScheme _scheme) { drawStyleEditor.Visible = false; backGroundColor.init(_scheme.BackGround); MiniDV.setScheme(_scheme); MiniDV.Flash(); isChange = false; ShowDialog(); }
public object Clone() { ColorScheme ret = new ColorScheme(); ret.bg = this.bg; for (int i = 0; i < 3; i++) { ret.ds[i] = (DrawStyle)this.ds[i].Clone(); } return ret; }
public void setScheme(ColorScheme _scheme) { colorScheme = (ColorScheme)_scheme.Clone(); }
private void redraw_all() { try { BUF = new Bitmap(this.Width, this.Height); } catch(Exception ex){ GC.Collect(); return; } buffer = Graphics.FromImage(BUF); if (colorScheme == null) colorScheme = new ColorScheme(); buffer.Clear(colorScheme.BackGround); for (int i = skillList.Count - 1; i >= 0; i--) { List<int> currTail = skillList[i].getTail; for (int j = currTail.Count - 1; j >= 0; j--) { int end = currTail[j]; DrawArrow(circleCenter[i], circleCenter[end], getFillSytle(drawModeList[i])); } } for (int i = skillList.Count - 1; i >= 0; i--) { drawSkill(circleCenter[i], skillList[i], getFillSytle(drawModeList[i])); } // drawAncher(new Point(Width/2,Height/2),5); if (anchorExist) { drawAnchor(Anchors, size_anchor, buffer); } try { formGraphis.DrawImage(BUF, 0, 0); } catch (OutOfMemoryException ex) { GC.Collect(); } }
private void 从文件读取_Click(object sender, EventArgs e) { if (openScheme.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ColorScheme scheme = new ColorScheme(); StreamReader reader = new StreamReader(openScheme.FileName, Encoding.Default); int length = ColorScheme.Size; string[] lists = new string[length]; try { for (int i = 0; i < length; i++) { lists[i] = reader.ReadLine(); } scheme.initInString(lists); MainDV.setScheme(scheme); } catch (Exception ex) { MessageBox.Show("该文件损坏"); return; } MainDV.Flash(); } }