Esempio n. 1
0
        private void redraw()
        {
            Cursor.Current = Cursors.WaitCursor;

              int width   = panel1.Width;
              int height  = panel1.Height;
              outputImage = new Bitmap( width, height, System.Drawing.Imaging.PixelFormat.Format24bppRgb );

              SimpleImageSynthesizer sis = new SimpleImageSynthesizer();
              sis.Width  = width;
              sis.Height = height;
              //sis.ImageFunction = RayCasting;

              Stopwatch sw = new Stopwatch();
              sw.Start();

              sis.RenderRectangle( outputImage, 0, 0, width, height );

              sw.Stop();
              labelElapsed.Text = String.Format( "Elapsed: {0:f}s", 1.0e-3 * sw.ElapsedMilliseconds );

              pictureBox1.Image = outputImage;

              Cursor.Current = Cursors.Default;
        }
Esempio n. 2
0
        /// <summary>
        /// Initialize image synthesizer (responsible for raster image computation).
        /// The 'imf' member has been already initialized..
        /// </summary>
        public static IRenderer getRenderer(IImageFunction imf)
        {
            SimpleImageSynthesizer sis = new SimpleImageSynthesizer();

            sis.ImageFunction = imf;
            return(sis);
        }