通过 VM 的全局脚本加载本地图像的步骤如下所示:
1、打开全局脚本,选择需要的示例
2、在运行函数中插入如下代码
1. public int Process()
2. {
3. //m_operateHandle 二次开发 SDK 操作句柄
4. if (m_operateHandle == IntPtr.Zero)
5. { return ImvsSdkPFDefine.IMVS_EC_NULL_PTR; }
6.
6. ImvsSdkPFDefine.IMVS_PF_INPUT_IMAGE_INFO stImageInfo
= new ImvsSdkPFDefine.IMVS_PF_INPUT_IMAGE_INFO();
7. stImageInfo.nDataType = 1;
8. stImageInfo.nModuleID = 16;//图像源模块序号
9.stImageInfo.strImagePath = "E:\\VSproject\\Demo\\12.jpg";
11.
12. ImvsPlatformSDK_API.IMVS_PF_SetImageData_CS(m_operate
Handle, stImageInfo);
13.
14. //System.Threading.Thread.Sleep(200);
15.
16. //自定义执行逻辑
17. //流程 1 运行一次
18. int nRet = ImvsPlatformSDK_API.IMVS_PF_ExecuteOnce_V30
_CS(m_operateHandle, 10002, null);
19. return nRet;
20.}