调用时来自sharpdx程序集的异常,为什么?

时间:2015-11-11 10:06:57

标签: c# sharpdx direct3d9

我正在尝试从给定维度的raw类型的文件加载卷,该维度在代码中指定为更高(mWidth,mHeight,mDepth)。我想使用Volume.FromFileInMemory方法。这是应该加载的代码片段。

Volume volume = new Volume(IntPtr.Zero);
BinaryReader reader = new BinaryReader(file);
byte[] buffer = new byte[mWidth * mHeight * mDepth];
int size = sizeof(byte);
reader.Read(buffer, 0, size * buffer.Length);
Volume.FromFileInMemory(volume,buffer,Filter.None,0);
reader.Close();

然而,当我执行代码时,我得到一个奇怪的异常,我真的不明白。

An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll
Additional information: HRESULT: [0x8876086C], Module: [SharpDX.Direct3D9], ApiCode: [D3DERR_INVALIDCALL/InvalidCall], Message: Unknown

我为FileInMemory方法阅读documentaion并搜索了一段时间,但我真的无法解决这个问题。

0 个答案:

没有答案