private void InitFigure() { graph = new Graph( picture.Width, picture.Height, Color.FromArgb(MyRegistry.LoadValue("background", Color.Black.ToArgb())), Color.FromArgb(MyRegistry.LoadValue("foreground", Color.White.ToArgb()))); Figure.InitMinMax(0, 0, graph.bmp.Width, graph.bmp.Height); int points = MyRegistry.LoadValue("points", 4); p = new Polygone(); for (int j = 0; j < points; j++) { p.AddFigure(Figure.RandomFigure()); } timer.Enabled = true; TopMost = true; }
public void Draw(Polygone polygone, Pen pen) { Figure f1 = null; foreach (Figure f2 in polygone.list) { if (f1 != null) { DrawLine(pen, f1.GetPixel(), f2.GetPixel()); } f1 = f2; } if (polygone.list.Count > 2) { DrawLine(pen, polygone.list[0].GetPixel(), polygone.list[polygone.list.Count - 1].GetPixel()); } }
public void Erase(Polygone polygone) { Draw(polygone, penBack); }
public void Draw(Polygone polygone) { Draw(polygone, penFore); }