[SlimDX] - Direct2D Off-screen rendering

Started by
-1 comments, last by derby 13 years, 11 months ago
Hi there, I am pretty new to DirectX and SlimDX and trying with the Sample code provided with the SlimDX. I am trying to render couple of polygons using Direct2D in off-screen mode and stream out the image imagerated. My question is, Is there anyway I can get the byte array of the image rendered from the Target so that I can encode and stream out the image. I am able to do this using Windows API Pack and Windows Image Component. Since our other projects are using SlimDX I would like to stick to it. Below is the part of the code I am trying.

 protected override void OnRender()
        {

            BitmapRenderTarget bmpTarget = Context2D.RenderTarget.CreateCompatibleRenderTarget();
            bmpTarget.BeginDraw();
            foreach (var geometry in _geometryList)
            {
                bmpTarget.FillGeometry(geometry, _brush);
            }

            bmpTarget.EndDraw();

            //How do I get the byte array from bmpTarget and Endcode into a png image.
        }

Thanks in advance.

This topic is closed to new replies.

Advertisement