Sign in to follow this  

Screen capture SharpDX

Recommended Posts

There is the problem of changing the color depth when I get a shot of the screen with the SharpDX. Normally only works if the selected format A8R8G8B8, for changing the format to A1R5G5B5, comes out with a blank error message:
HRESULT: [0x8876086C], Module: [SharpDX.Direct3D9], ApiCode: [D3DERR_INVALIDCALL/InvalidCall], Message: Unknown
?ode C#:


var format = SharpDX.Direct3D9.Format.A8B8G8R8;
present_paramsS.Windowed = true;
present_paramsS.BackBufferFormat = format;
present_paramsS.SwapEffect = SharpDX.Direct3D9.SwapEffect.Discard;
present_paramsS.BackBufferWidth = Screen.PrimaryScreen.WorkingArea.Width;
present_paramsS.BackBufferHeight = Screen.PrimaryScreen.WorkingArea.Height;
dS = new SharpDX.Direct3D9.Device(new SharpDX.Direct3D9.Direct3DEx(),
sS = SharpDX.Direct3D9.Surface.CreateOffscreenPlain(

The main objective to minimize the size of the image. Are there any more settings in the initialization that can affect the volume of the resulting screen shot?

Share this post

Link to post
Share on other sites

I don't know about the SharpDX image exporter, but typically those type of functions don't convert the format of the texture for you.  Is it possible for you to do a compression on the image after it is saved on the CPU side?  That would allow for arbitrary format selection, plus you could take as much time as needed for the conversion if you spin off another thread to do the processing for you.

Share this post

Link to post
Share on other sites

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