• Advertisement
Sign in to follow this  

[SlimDX] - Direct2D Off-screen rendering

This topic is 2853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement