关于 Unity控制佳能单反拍照及数据获取。
Unity控制佳能实时画面。
我发现在Editor里面运行 没有任何问题,
但是一旦打包出PC端,运行exe会在:
//create stream to image
unsafe
{
Debug.Log("888");
ums = new UnmanagedMemoryStream((byte*)jpgPointer.ToPointer(), (long)length , (long)length , FileAccess.Read);
Debug.Log("999");
}
Debug.Log("555===" + jpgPointer);
Debug.Log("5555===" + length );
TextureBitmap = new Bitmap(ums, true);
Debug.Log("666");
ms = new MemoryStream();
Debug.Log("777");
TextureBitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
Debug.Log("给图片赋值 "+ TextureBitmap.Size);
TextureBytes = ms.GetBuffer();
Debug.Log("图片流开始!");
//fire the LiveViewUpdated event with the live view image stream
if (LiveViewUpdated != null) LiveViewUpdated(ums);
ums.Close();
代码运行至:
TextureBitmap = new Bitmap(ums, true);
这一段 抛出以下异常
