コード例 #1
0
        public List <BreakRegion> Pdo_FencePolygonsGet(UInt32 hPdoHandle)
        {
            TPDO_DRAW_FENCEPOLYGONS fencePolygons;
            List <BreakRegion>      list = new List <BreakRegion>();

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawRectGet hPdoHandle:" + hPdoHandle);
            UInt32 retVal = IVXDrawSDKProtocol.Pdo_FencePolygonsGet(hPdoHandle, out fencePolygons);

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawRectGet ret:" + retVal);

            for (int i = 0; i < fencePolygons.dwNum; i++)
            {
                BreakRegion temp = new BreakRegion()
                {
                    ID              = (uint)i,
                    RegionType      = fencePolygons.atCrossLineList[i].uDirectType,
                    RegionPointList = new List <Point>(),
                };
                for (int j = 0; j < fencePolygons.atCrossLineList[i].sPointSet.nRealSize; j++)
                {
                    temp.RegionPointList.Add(fencePolygons.atCrossLineList[i].sPointSet.Points[j]);
                }
                list.Add(temp);
            }
            return(list);
        }
コード例 #2
0
        public UInt32 Pdo_FencePolygonsSet(UInt32 hPdoHandle, List <BreakRegion> polygons)
        {
            TPDO_DRAW_FENCEPOLYGONS fencePolygons;

            fencePolygons.dwNum = (uint)polygons.Count;

            TCROSS_FRAME_GRAPH[] ps = new TCROSS_FRAME_GRAPH[Common.PDO_DRAW_RECT_MAXNUM];
            for (int i = 0; i < polygons.Count; i++)
            {
                ps[i].sPointSet.nRealSize = (uint)polygons[i].RegionPointList.Count;
                ps[i].sPointSet.Points    = new Point[Common.PDO_POINT_ARRAY_SIZE];
                polygons[i].RegionPointList.CopyTo(0, ps[i].sPointSet.Points, 0, polygons[i].RegionPointList.Count);
                ps[i].uDirectType = polygons[i].RegionType;
            }

            fencePolygons.atCrossLineList = ps;

            UInt32 retVal = IVXDrawSDKProtocol.Pdo_FencePolygonsSet(hPdoHandle, ref fencePolygons);

            //for (int i = 0; i < fencePolygons.dwNum; i++)
            //{
            //    polygons.Add(fencePolygons.atCrossLineList[i].sPointSet);
            //}
            return(retVal);
        }
コード例 #3
0
        public List <PassLine> Pdo_CrossLinesGet(UInt32 hPdoHandle)
        {
            TPDO_DRAW_CROSSLINES crossLines;
            List <PassLine>      list = new List <PassLine>();

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawRectGet hPdoHandle:" + hPdoHandle);
            UInt32 retVal = IVXDrawSDKProtocol.Pdo_CrossLinesGet(hPdoHandle, out crossLines);

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawRectGet ret:" + retVal);

            for (int i = 0; i < crossLines.dwNum; i++)
            {
                uint passtype = 2;
                if (crossLines.atCrossLineList[i].uDirectType == 0)
                {
                    passtype = 1;
                }
                else if (crossLines.atCrossLineList[i].uDirectType == 1)
                {
                    passtype = 0;
                }

                list.Add(new PassLine()
                {
                    DirectLineEnd   = crossLines.atCrossLineList[i].ptDirectEnd,
                    DirectLineStart = crossLines.atCrossLineList[i].ptDirectBegin,
                    ID            = (uint)i,
                    PassLineEnd   = crossLines.atCrossLineList[i].ptEnd,
                    PassLineStart = crossLines.atCrossLineList[i].ptBegin,
                    PassLineType  = passtype,
                }
                         );
            }
            return(list);
        }
コード例 #4
0
        /// <summary>
        /// 设置要显示的本地图片文件
        /// </summary>
        /// <param name="hPdoHandle">标示句柄</param>
        /// <param name="image">图片数据</param>
        /// <returns>成功返回PDO_OK,失败返回错误码</returns>
        public UInt32 Pdo_DisplayPicDataSet(UInt32 hPdoHandle, System.Drawing.Image image)
        {
            IntPtr pPicData      = IntPtr.Zero;
            UInt32 dwPicDataSize = 0;

            if (image != null)
            {
                byte[] bytes = Common.ImageToJpegBytes(image);

                dwPicDataSize = (uint)bytes.Length;
                pPicData      = Marshal.AllocHGlobal(bytes.Length);

                Marshal.Copy(bytes, 0, pPicData, bytes.Length);
            }
            UInt32 dwPicType = (uint)E_PDO_PIC_TYPE.E_PDO_PIC_JPG;//图片格式类型,见E_PDO_PIC_TYPE

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DisplayPicDataSet hPdoHandle:" + hPdoHandle);
            UInt32 retVal = IVXDrawSDKProtocol.Pdo_DisplayPicDataSet(hPdoHandle, pPicData, dwPicDataSize, dwPicType);

            //if (0 != retVal)
            //{
            //    // 调用失败,抛异常
            //    CheckError();
            //}
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DisplayPicDataSet ret:" + retVal);

            if (pPicData != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(pPicData);
            }

            return(retVal);
        }
コード例 #5
0
        public UInt32 Pdo_DrawRectSet(UInt32 hPdoHandle, List <System.Drawing.Rectangle> rects)
        {
            TPDO_DRAW_RECT ptDrawRect = new TPDO_DRAW_RECT();

            ptDrawRect.dwRectNum  = (uint)rects.Count;
            ptDrawRect.atRectList = new TPDO_RECT[Common.PDO_DRAW_RECT_MAXNUM];

            for (int i = 0; i < ptDrawRect.dwRectNum; i++)
            {
                ptDrawRect.atRectList[i] = new TPDO_RECT {
                    dwHeight = (uint)rects[i].Height, dwWidth = (uint)rects[i].Width, dwX = (uint)rects[i].X, dwY = (uint)rects[i].Y
                };
            }

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawRectSet hPdoHandle:" + hPdoHandle);
            UInt32 retVal = IVXDrawSDKProtocol.Pdo_DrawRectSet(hPdoHandle, ref ptDrawRect);

            //if (0 != retVal)
            //{
            //    // 调用失败,抛异常
            //    CheckError();
            //}
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawRectSet ret:" + retVal);

            return(retVal);
        }
コード例 #6
0
        /// <summary>
        /// 清除播放绘制内容
        /// </summary>
        /// <param name="hPdoHandle">标示句柄</param>
        /// <returns>成功返回PDO_OK,失败返回错误码</returns>
        public UInt32 Pdo_DrawClear(UInt32 hPdoHandle)
        {
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawClear hPdoHandle:" + hPdoHandle);
            UInt32 retVal = IVXDrawSDKProtocol.Pdo_DrawClear(hPdoHandle);

            //if (0 != retVal)
            //{
            //    // 调用失败,抛异常
            //    CheckError();
            //}
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawClear ret:" + retVal);
            return(retVal);
        }
コード例 #7
0
        /// <summary>
        /// 设置绘图类型(如画线,画矩形等内容)
        /// </summary>
        /// <param name="hPdoHandle">标示句柄</param>
        /// <param name="dwDrawType">搜索行为过滤类型 见E_PDO_DRAW_TYPE</param>
        /// <returns>成功返回PDO_OK,失败返回错误码</returns>
        public UInt32 Pdo_DrawTypeSet(UInt32 hPdoHandle, E_PDO_DRAW_TYPE dwDrawType)
        {
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawTypeSet hPdoHandle:" + hPdoHandle + ",dwDrawType:" + dwDrawType);
            UInt32 retVal = IVXDrawSDKProtocol.Pdo_DrawTypeSet(hPdoHandle, (uint)dwDrawType);

            //if (0 != retVal)
            //{
            //    // 调用失败,抛异常
            //    CheckError();
            //}
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawTypeSet ret:" + retVal);
            return(retVal);
        }
コード例 #8
0
        /// <summary>
        /// 开启显示图片叠加控制
        /// </summary>
        /// <param name="hWnd">显示图片的窗口句柄</param>
        /// <param name="dwUserData"></param>
        /// <returns>返回操作标示句柄</returns>
        public UInt32 Pdo_Open(IntPtr hWnd, UInt32 dwUserData)
        {
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_Open hWnd:" + hWnd);
            m_pfuncMouseEventCb = OnPDOMouseOptNtfCB;
            UInt32 phPdoHandle = 0;
            UInt32 retVal      = IVXDrawSDKProtocol.Pdo_Open(hWnd, null, dwUserData, out phPdoHandle);

            //if (0 != retVal)
            //{
            //    // 调用失败,抛异常
            //    CheckError();
            //}
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_Open ret:" + retVal);
            return(phPdoHandle);
        }
コード例 #9
0
        /// <summary>
        /// 设置要显示的本地图片文件
        /// </summary>
        /// <param name="hPdoHandle">标示句柄</param>
        /// <param name="picFilePath">图片文件路径</param>
        /// <returns>成功返回PDO_OK,失败返回错误码</returns>
        public UInt32 Pdo_DisplayPicFileSet(UInt32 hPdoHandle, string picFilePath)
        {
            TPDO_FILE_PATH tPicFilePath = new TPDO_FILE_PATH();

            tPicFilePath.szFilePath = picFilePath;
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DisplayPicFileSet hPdoHandle:" + hPdoHandle + ",PicFilePath:" + picFilePath);
            UInt32 retVal = IVXDrawSDKProtocol.Pdo_DisplayPicFileSet(hPdoHandle, tPicFilePath);

            //if (0 != retVal)
            //{
            //    // 调用失败,抛异常
            //    CheckError();
            //}
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DisplayPicFileSet ret:" + retVal);
            return(retVal);
        }
コード例 #10
0
        public UInt32 Pdo_CrossLinesSet(UInt32 hPdoHandle, List <PassLine> crossLineList)
        {
            TPDO_DRAW_CROSSLINES crossLines;

            crossLines.dwNum = (uint)crossLineList.Count;

            TPDO_CROSSLINE[] ps = new TPDO_CROSSLINE[Common.PDO_DRAW_RECT_MAXNUM];
            for (int i = 0; i < crossLineList.Count; i++)
            {
                uint passtype = 2;
                if (crossLineList[i].PassLineType == 0)
                {
                    passtype = 1;
                }
                else if (crossLineList[i].PassLineType == 1)
                {
                    passtype = 0;
                }

                ps[i] = new TPDO_CROSSLINE()
                {
                    ptBegin       = crossLineList[i].PassLineStart,
                    ptDirectBegin = crossLineList[i].DirectLineStart,
                    ptDirectEnd   = crossLineList[i].DirectLineEnd,
                    ptEnd         = crossLineList[i].PassLineEnd,
                    uDirectType   = passtype,
                };
            }

            crossLines.atCrossLineList = ps;

            UInt32 retVal = IVXDrawSDKProtocol.Pdo_CrossLinesSet(hPdoHandle, ref crossLines);

            //for (int i = 0; i < fencePolygons.dwNum; i++)
            //{
            //    polygons.Add(fencePolygons.atCrossLineList[i].sPointSet);
            //}
            return(retVal);
        }
コード例 #11
0
        /// <summary>
        /// 获取绘制的矩形信息
        /// </summary>
        /// <param name="hPdoHandle">标示句柄</param>
        /// <returns>绘制的矩形信息</returns>
        public List <System.Drawing.Rectangle> Pdo_DrawRectGet(UInt32 hPdoHandle)
        {
            TPDO_DRAW_RECT ptDrawRect = new TPDO_DRAW_RECT();

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawRectGet hPdoHandle:" + hPdoHandle);
            UInt32 retVal = IVXDrawSDKProtocol.Pdo_DrawRectGet(hPdoHandle, out ptDrawRect);

            //if (0 != retVal)
            //{
            //    // 调用失败,抛异常
            //    CheckError();
            //}
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXDrawSDKProtocol Pdo_DrawRectGet ret:" + retVal);
            List <System.Drawing.Rectangle> ret = new List <System.Drawing.Rectangle>();

            for (int i = 0; i < ptDrawRect.dwRectNum; i++)
            {
                ret.Add(
                    new System.Drawing.Rectangle((int)ptDrawRect.atRectList[i].dwX, (int)ptDrawRect.atRectList[i].dwY, (int)ptDrawRect.atRectList[i].dwWidth, (int)ptDrawRect.atRectList[i].dwHeight)
                    );
            }
            return(ret);
        }