Пример #1
0
        private void RayTrace()
        {
            ControlPanel.Enabled = false;

            PictureBox.Image = new Bitmap(PictureBox.Size.Width, PictureBox.Size.Height);
            PictureBox.Update();

            rayTracer.Size = PictureBox.Image.Size;

            rayTracer.Scene = scene;
            rayTracer.BackColor = Color.Black;

            rayTracer.Raytrace(PictureBox.Image, () =>
            {
                Invoke(new Action(() =>
                {
                    PictureBox.Refresh();
                }));
            }, () =>
            {
                Invoke(new Action(() =>
                {
                    ControlPanel.Enabled = true;
                }));
            });
        }