Jump to content
  • Advertisement
Sign in to follow this  
derby

[SlimDX] - Direct2D Off-screen rendering

This topic is 3064 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!