Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello!

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(),
                                                0,
                                                SharpDX.Direct3D9.DeviceType.Hardware,
                                                IntPtr.Zero,
                                                SharpDX.Direct3D9.CreateFlags.HardwareVertexProcessing,
                                                present_paramsS);

              sS = SharpDX.Direct3D9.Surface.CreateOffscreenPlain(
                  dS,
                  Screen.PrimaryScreen.Bounds.Width,
                  Screen.PrimaryScreen.Bounds.Height,
                  format,
                  SharpDX.Direct3D9.Pool.Scratch);




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?
C#

Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900