纳金网
标题:
Unity3D 调用DLL类库
[打印本页]
作者:
狂风大尉
时间:
2014-6-30 14:41
标题:
Unity3D 调用DLL类库
1。将CanmeraDll.dll文件放入根目录
2。编写如下声明代码
[DllImport("CanmeraDll")]
public static extern int Net_Cam_Init(ref int CamID, ref int w, ref int h, ref int BFormat);
[DllImport("CanmeraDll")]
public static extern IntPtr Net_Cam_GetFrameBuff(ref int Cam, ref int Size);
[DllImport("CanmeraDll")]
public static extern int Net_Cam_UnInit();
复制代码
3。调用代码
void Start () {
if(NetCamWrapper.Net_Cam_Init(ref Cam_Id, ref wid, ref hig, ref BFormat) == 1){
NetCamStatus = true;
Debug.Log("NetCamera Have Init!");
}else
Debug.Log("NetCamera Don't Init!");
}
复制代码
作者:
HIDEOKOJIMA
时间:
2014-6-30 16:02
Thanks for sharing !
作者:
wucnj
时间:
2014-7-1 10:53
感谢分享!!!
作者:
icerein
时间:
2014-7-1 12:43
感谢分享!!!
欢迎光临 纳金网 (http://go.narkii.com/club/)
Powered by Discuz! X2.5