• Advertisement
Sign in to follow this  

SharpDx Save frame to bitmpap

This topic is 495 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 to all,
I'm new in this forum.
I'm moving my 2D simulator developed with SlimDx to SharpDx because i want to improve it and transorm it in a 3D simulator (the engine inside is already 3D).
The last step of this porting to SharpDX is the creation of a video of my simulation, I save frame by frame and in the end I merge all with ffmpeg.
So if with SlimDx save a frame is very easy, with SharpDx doesn't seem so.
This is my code with SlimDx:

using (var backBuffer = SharpDX.Direct3D11.Resource.FromSwapChain<Texture2D>(swapChain, 0))
using (MemoryStream ms = new MemoryStream())
   Texture2D.ToStream(context, backbuffer, ImageFileFormat.Bmp, ms);
   System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(ms);
   return bitmap;

I'm searching everywhere but I can't find something that works :angry:

Share this post

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

  • Advertisement