RenderSurface() public method

public RenderSurface ( Graphics graphics, long matrix, int adjustmentValue, bool newRender = false ) : void
graphics System.Drawing.Graphics
matrix long
adjustmentValue int
newRender bool
return void
Exemplo n.º 1
0
        public static void Draw3DSurface(PictureBox pBox)
        {
            //set up objects
            Bitmap bitmap = new Bitmap(width, height);
            Graphics graphics = Graphics.FromImage(bitmap);
            renderer3d = new Surface3DRenderer(observableXYZ.x, observableXYZ.y, observableXYZ.z, screenXY.X, screenXY.Y, width, height, zoom, 0, 0);
            renderer3d.MultiThreaded = MultiThreaded;

            //set mouse events
            pBox.Paint += Draw3DSurface_Paint;
            pBox.MouseWheel += Draw3DSurface_MouseWheel;
            pBox.MouseDown += Draw3DSurface_MouseDown;
            pBox.MouseUp += Draw3DSurface_MouseUp;
            pBox.MouseMove += Draw3DSurface_MouseMove;
            CapturingMouse_3DSurface = true;

            if (BlackAndWhite) renderer3d.ColorSchema = ColorSchema.Greyscale();
            else renderer3d.ColorSchema = ColorSchema.Hsv;

            //render surface
            renderer3d.RenderSurface(graphics, pixelMatrix, AdjustmentValue);
            graphics.Dispose();
            pBox.Image = bitmap;
        }
 private void Form1_Paint(object sender, PaintEventArgs e)
 {
     e.Graphics.Clear(BackColor);
     sr.RenderSurface(e.Graphics);
 }
Exemplo n.º 3
0
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     e.Graphics.Clear(BackColor);
     sr.RenderSurface(e.Graphics);
 }