Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# SlimDX当游戏窗口FULLMODE抛出错误时_C#_Slimdx - Fatal编程技术网

C# SlimDX当游戏窗口FULLMODE抛出错误时

C# SlimDX当游戏窗口FULLMODE抛出错误时,c#,slimdx,C#,Slimdx,DxScreenCapture.cs public class DxScreenCapture { Device d; public DxScreenCapture() { PresentParameters present_params = new PresentParameters(); present_params.Windowed = true; prese

DxScreenCapture.cs

 public class DxScreenCapture
    {
        Device d;

        public DxScreenCapture()
        {
            PresentParameters present_params = new PresentParameters();
            present_params.Windowed = true;
            present_params.SwapEffect = SwapEffect.Discard;
            d = new Device(new Direct3D(), 0, DeviceType.Hardware, IntPtr.Zero, CreateFlags.SoftwareVertexProcessing, present_params);
        }

        public Surface CaptureScreen()
        {
            Surface s = Surface.CreateOffscreenPlain(d, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8, Pool.Scratch);
            d.GetFrontBufferData(0, s);
            return s;
        }
    }
捕获映像并序列化以发送到服务器

 using (Surface s = cap.CaptureScreen())
            {

                BinaryFormatter bf = new BinaryFormatter();
               Bitmap bitmap = new Bitmap(SlimDX.Direct3D9.Surface.ToStream(s, SlimDX.Direct3D9.ImageFileFormat.Bmp));

                ns = client.GetStream();
                bf.Serialize(ns, bitmap); // ns = NetworkStream
            }
当游戏不运行时,状态很好。 但游戏是在全窗口模式下运行的 豁免

SlimDX.Direct3D9.Direct3D9Exception
这是内在的例外:

D3DERR_INVALIDCALL: Invalid call (-2005530516)
也许也适合你的问题

我猜您的图形卡可能不支持1x1 backbuffer

查看调试运行时的输出。每当你得到一个 无效呼叫很有可能有某种诊断 那里的信息表明你做错了什么


谢谢,我将尝试运行另一台计算机。。然后。。如何解决这个问题?