Sign in to follow this  

SharpDx Save frame to bitmpap

This topic is 399 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);
   bitmap.RotateFlip(RotateFlipType.RotateNoneFlipY);
   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

This topic is 399 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this