Ejemplo n.º 1
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, "IVXSDKProtocol Pdo_DrawRectSet hPdoHandle:" + hPdoHandle);
            UInt32 retVal = IVXSDKProtocol.Pdo_DrawRectSet(hPdoHandle, ref ptDrawRect);

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

            return(retVal);
        }
Ejemplo n.º 2
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, "IVXSDKProtocol Pdo_DrawRectGet hPdoHandle:" + hPdoHandle);
            UInt32 retVal = IVXSDKProtocol.Pdo_DrawRectGet(hPdoHandle, out ptDrawRect);

            //if (0 != retVal)
            //{
            //    // 调用失败,抛异常
            //    CheckError();
            //}
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXSDKProtocol 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);
        }
Ejemplo n.º 3
0
 public static extern UInt32 Pdo_DrawRectSet(UInt32 hPdoHandle, ref TPDO_DRAW_RECT ptDrawRect);