public PolygonFillForm() { InitializeComponent(); FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; MinimizeBox = false; DirectBitmap = new DirectBitmap( pictureBox1.Width - pictureBox1.Padding.Horizontal, pictureBox1.Height - pictureBox1.Padding.Vertical); pictureBox1.Image = DirectBitmap.Bitmap; (NSquaresHorizontal, NSquaresVertical) = (1, 1); MainController = new MainController( NSquaresHorizontal, NSquaresVertical, DirectBitmap); Background = new SolidBackgound(BgColor); MainLight = new LightSource(); MainLight.Color = Color.White; (MainLight.ScreenW, MainLight.ScreenH) = (DirectBitmap.Width, DirectBitmap.Height); Timer = new Timer(); SetTimer(); Exact.Checked = BgFromColorRadioButton.Checked = ConstNormalVectorRadioButton.Checked = true; }
private void BgFromColorRadioButton_CheckedChanged(object sender, EventArgs e) { if (BgFromColorRadioButton.Checked) { if (Background != null) { Background.Dispose(); } Background = new SolidBackgound(BgColor); } }
private void SelectColorButton_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); if (cd.ShowDialog() == DialogResult.OK) { BgColor = cd.Color; Background = new SolidBackgound(BgColor); BgFromColorRadioButton.Checked = true; } }