Example #1
0
        /// <summary>
        /// 鼠标测温
        /// </summary>
        /// <param name="graphic"></param>
        /// <param name="w"></param>
        /// <param name="h"></param>
        void DrawMouseTemp(Graphics graphic, int w, int h)
        {
            Point pt = MousePosition;

            Point ptLeftUp    = this.PointToScreen(new Point(0, 0));
            Point ptRightDown = this.PointToScreen(new Point(this.Width - 1, this.Height - 1));

            if (pt.X > ptRightDown.X || pt.X < ptLeftUp.X || pt.Y > ptRightDown.Y || pt.Y < ptLeftUp.Y)
            {
                return;
            }

            MagDevice device = _DataDisplay.GetDevice();

            GroupSDK.CAMERA_INFO info = device.GetCamInfo();

            int intFPAx = _ptMouse.X * info.intFPAWidth / w;                          //鼠标X
            int intFPAy = info.intFPAHeight - _ptMouse.Y * info.intFPAHeight / h - 1; //鼠标Y

            int intTemp = device.GetTemperatureProbe((uint)intFPAx, (uint)intFPAy, 1);

            GroupSDK.FIX_PARAM param = new GroupSDK.FIX_PARAM();
            device.GetFixPara(ref param);

            if (_DataDisplay.GetDisplayConfig().bEnableExtCorrect)
            {
                intTemp = device.FixTemperature(intTemp, param.fEmissivity, (uint)intFPAx, (uint)intFPAy);
            }


            string sText = (intTemp * 0.001f).ToString("0.0") + "坐标X:" + intFPAx + "坐标Y:" + intFPAy;

            int cx = (int)graphic.MeasureString(sText, this.Font).Width;
            int cy = (int)graphic.MeasureString(sText, this.Font).Height;

            int x = _ptMouse.X;
            int y = _ptMouse.Y - cy; //默认右上

            if (_ptMouse.Y < cy)     //处于上边沿
            {
                y = _ptMouse.Y + 16;

                if (_ptMouse.X < cx)//处于左边沿
                {
                    x = _ptMouse.X + 16;
                }
                else
                {
                    x = _ptMouse.X - cx;
                }
            }
            else if (_ptMouse.X > w - cx)//右边沿
            {
                x = _ptMouse.X - cx;
            }

            graphic.FillRectangle(Brushes.White, new Rectangle(x, y, cx, cy));
            graphic.DrawString(sText, this.Font, Brushes.Black, (float)x, (float)y);
        }
Example #2
0
 public void GetFixPara(ref GroupSDK.FIX_PARAM param)
 {
     GroupSDK.MAG_GetFixPara(m_intChannelIndex, ref param);
 }
Example #3
0
 public float SetFixPara(GroupSDK.FIX_PARAM param, int isEnableCameraCorrect)
 {
     return(GroupSDK.MAG_SetFixPara(m_intChannelIndex, ref param, isEnableCameraCorrect));
 }
Example #4
0
        /// <summary>
        /// 设置红外参数
        /// </summary>
        /// <param name="param">红外参数</param>
        /// <returns>是否成功</returns>
        private Boolean Config(GroupSDK.FIX_PARAM param)
        {
            mMagDevice.SetFixPara(param, 1);

            return(true);
        }