private void InitializeOptions() { _points = new List <Point>(); ClientSize = new Size(1280, 800); var pen = new Pen(Color.Black); var brushColor = Color.Black; var graphics = CreateGraphics(); //Иницилизация наших классов _drawLine = new DrawLine(graphics, pen, brushColor); _drawRectangles = new DrawRectangle(graphics, pen, brushColor); _drawPoint = new DrawPoint(CreateGraphics(), pen, brushColor); _drawCircle = new DrawCircle(graphics, pen, brushColor); _drawTriangle = new DrawTriangle(graphics, pen, brushColor); EventMainColor(); EventBrushColor(); mainColorButton.BackColor = pen.Color; brushColorButton.BackColor = brushColor; _count = 0; PositionLabel.Location = new Point(this.Width - 125, this.Height - 70); TimerDraw.Start(); }
public MainWindow() { InitializeComponent(); MouseWheel += new MouseEventHandler(Window_MouseWheel); SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); DoubleBuffered = true; game = new Game(); camera = game.Camera; data = game.Data; renderer = new Renderer(game); game.Start(); TimerDraw.Start(); }