public static RENDERTARGET CreateRenderTargetBitmap(int width, int height, SceneView3D view, IDrawingBrush <IScene3D> scene)
        {
            var rt  = new RENDERTARGET(width, height, 96, 96, System.Windows.Media.PixelFormats.Default);
            var ctx = new Canvas2DFactory();

            ctx.DrawScene(rt, new Size(width, height), view, scene);
            return(rt);
        }
Example #2
0
        public void Draw(Action <ICanvas2D> action)
        {
            var visual          = new DrawingVisual();
            var context         = visual.RenderOpen();
            var canvas2DFactory = new Canvas2DFactory(context);

            using (var dc = canvas2DFactory.UsingCanvas2D(_RenderTarget.PixelWidth, _RenderTarget.PixelHeight))
            {
                action(dc);
            }

            context.Close();
            _RenderTarget.Render(visual);
        }