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:
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?