private void LoadImageBtn_Click(object sender, EventArgs e)
        {
            if (OpenImageDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    using (var stream = OpenImageDialog.OpenFile())
                        image = new Bitmap(stream);

                    imageName = Path.GetFileNameWithoutExtension(OpenImageDialog.FileName)?.Trim();

                    Properties.Settings.Default.LastImage = OpenImageDialog.FileName;
                }
                catch (ArgumentException)
                {
                    MessageBox.Show(this, @"The selected file was not a valid image.", @"Invalid image file",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    image     = null;
                    imageName = null;
                }
                finally
                {
                    isChanged = true; // force update
                    RedrawTimer.Stop();
                    RedrawTimer.Start();
                }
            }
        }
        private void FilterTextBox_TextChanged(object sender, EventArgs e)
        {
            if (!AutomaticRedrawChkBox.Checked)
            {
                return;
            }

            RedrawTimer.Stop();
            RedrawTimer.Start();
        }
Esempio n. 3
0
        private void RedrawTimer_Tick(object sender, EventArgs e)
        {
            CurrentTest.Step(Settings);
            Renderer.OpenGLDraw(CurrentTest);
            OpenGLControl.Draw();

            int errorCode = 0;

            if ((errorCode = Gl.glGetError()) > 0)
            {
                RedrawTimer.Stop();

                //Handled by the OpenGLControl
                //MessageBox.Show(Glu.gluErrorString(errorCode));
            }
        }