Exemplo n.º 1
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);
        }