Ejemplo n.º 1
0
        /// <summary>
        /// 上传图像显示刷新
        /// </summary>
        /// <param name="imageInfo"></param>
        public void OnUpFlawSpliceImageData(stSpliceImageData spliceImageData)
        {
            //if (GlobalDataInterface.nVer == 0)
            //{
            try
            {
                //if (this == Form.ActiveForm)
                //{
                if (this.InvokeRequired)
                {
                    this.BeginInvoke(new GlobalDataInterface.SpliceImageDataEventHandler(OnUpFlawSpliceImageData), spliceImageData);
                }
                else
                {
                    if (spliceImageData.imageInfo.nRouteId != m_CurrentIPM_ID)//add by xcw 20200909
                    {
                        return;
                    }
                    m_spliceImageData = new stSpliceImageData(spliceImageData.imagedataC.Length);
                    m_spliceImageData.ToCopy(spliceImageData);
                    m_spliceImageBin = new byte[GlobalDataInterface.globalIn_spliceimgBin.Length];
                    Array.Copy(GlobalDataInterface.globalIn_spliceimgBin, m_spliceImageBin, GlobalDataInterface.globalIn_spliceimgBin.Length);
                    ColorPictureChange();
                }
                //}
            }
            catch (Exception ex)
            {
                Trace.WriteLine("QualityParamSetForm-ColorSetForm中函数OnUpImageInfo出错" + ex);
#if REALEASE
                GlobalDataInterface.WriteErrorInfo("QualityParamSetForm-ColorSetForm中函数OnUpImageInfo出错" + ex);
#endif
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 上传图像显示刷新
        /// </summary>
        /// <param name="imageInfo"></param>
        public void OnUpSpotImageData(stSpliceImageData spotImageData)
        {
            try
            {
                if (this == Form.ActiveForm)
                {
                    if (this.InvokeRequired)
                    {
                        this.BeginInvoke(new GlobalDataInterface.SpotImageDataEventHandler(OnUpSpotImageData), spotImageData);
                    }
                    else
                    {
                        if (spotImageData.imageInfo.nRouteId != 272 || spotImageData.imageInfo.width != m_srcBitamp.Width)//|| spotImageData.imageInfo.height != 20* m_srcBitamp.Height)
                        {
                            return;
                        }
                        this.DstpictureBox.Width  = m_srcBitamp.Width;
                        this.DstpictureBox.Height = spotImageData.imageInfo.height;
                        m_spotimageData           = new stSpliceImageData(spotImageData.imagedataC.Length);
                        m_spotimageData.ToCopy(spotImageData);
                        byte[] tempImagedata = new byte[spotImageData.imageInfo.width * spotImageData.imageInfo.height * 2];
                        m_SpotDetectRGBImage = new byte[spotImageData.imageInfo.width * spotImageData.imageInfo.height * 4];
                        Array.Copy(m_spotimageData.imagedataC, 0, tempImagedata, 0, m_spotimageData.imageInfo.width * m_spotimageData.imageInfo.height * 2);
                        Commonfunction.YUV422ChangeToRGB(tempImagedata, ref m_SpotDetectRGBImage, m_spotimageData.imageInfo.width, m_spotimageData.imageInfo.height);
                        this.FlawAreatextBox.Text = m_spotimageData.imageInfo.unFlawArea.ToString();
                        this.FlawNumtextBox.Text  = m_spotimageData.imageInfo.unFlawNum.ToString();
                        this.DstpictureBox.Invalidate();
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine("QualityParamSetForm-ColorSetForm中函数OnUpImageInfo出错" + ex);
#if REALEASE
                GlobalDataInterface.WriteErrorInfo("QualityParamSetForm-ColorSetForm中函数OnUpImageInfo出错" + ex);
#endif
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 上传图像显示刷新
        /// </summary>
        /// <param name="imageInfo"></param>
        public void OnUpRotImageData(stSpliceImageData spotImageData)
        {
            try
            {
                if (this == Form.ActiveForm)
                {
                    if (this.InvokeRequired)
                    {
                        this.BeginInvoke(new GlobalDataInterface.RotImageDataEventHandler(OnUpRotImageData), spotImageData);
                    }
                    else
                    {
                        if (spotImageData.imageInfo.nRouteId != m_RotCurrentIPM_ID)
                        {
                            return;
                        }
                        byte[] imagedata;


                        //获取图片
                        //if (Commonfunction.ChanelInIPMIndex(m_ChanelIDList[m_CurrentRotChannelIndex]) == 0)
                        //{
                        //    imagedata = new byte[(3 * BackgroundLength + (spotImageData.imageInfo.nBottom[0] - spotImageData.imageInfo.nTop[0]) * 2) * spotImageData.imageInfo.width * 2];
                        //    m_rotimageRGB = new byte[(3 * BackgroundLength + (spotImageData.imageInfo.nBottom[0] - spotImageData.imageInfo.nTop[0]) * 2) * spotImageData.imageInfo.width * 4];
                        //    Array.Copy(spotImageData.imagedataC, spotImageData.imageInfo.nTop[0] * spotImageData.imageInfo.width * 2, imagedata, BackgroundLength * spotImageData.imageInfo.width * 2, spotImageData.imageInfo.width * (spotImageData.imageInfo.nBottom[0] - spotImageData.imageInfo.nTop[0]) * 2);
                        //    if (spotImageData.imagedataIR.Length > 0)
                        //    {
                        //        Array.Copy(spotImageData.imagedataIR, spotImageData.spotImageInfo.nTop[0] * spotImageData.spotImageInfo.width * 2, imagedata, (2 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0])) * spotImageData.spotImageInfo.width * 2, spotImageData.spotImageInfo.width * (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2);
                        //    }
                        //    Commonfunction.YUV422ChangeToRGB(imagedata, ref m_rotimageRGB, spotImageData.spotImageInfo.width, 3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2);
                        //    this.RotAreatextBox.Text = spotImageData.spotImageInfo.unFlawArea[0].ToString();
                        //    this.RotNumtextBox.Text = spotImageData.spotImageInfo.unFlawNum[0].ToString();
                        //    m_rotHeight = 3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2;
                        //}
                        //else
                        //{
                        //    imagedata = new byte[(3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2) * spotImageData.spotImageInfo.width * 2];
                        //    m_rotimageRGB = new byte[(3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2) * spotImageData.spotImageInfo.width * 4];
                        //    if (spotImageData.imagedataIR.Length > 0)
                        //    {
                        //        Array.Copy(spotImageData.imagedataC, spotImageData.spotImageInfo.nTop[1] * spotImageData.spotImageInfo.width * 2, imagedata, BackgroundLength * spotImageData.spotImageInfo.width * 2, spotImageData.spotImageInfo.width * (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2);
                        //    }
                        //    Array.Copy(spotImageData.imagedataIR, spotImageData.spotImageInfo.nTop[1] * spotImageData.spotImageInfo.width * 2, imagedata, (2 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1])) * spotImageData.spotImageInfo.width * 2, spotImageData.spotImageInfo.width * (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2);
                        //    Commonfunction.YUV422ChangeToRGB(imagedata, ref m_rotimageRGB, spotImageData.spotImageInfo.width, 3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2);
                        //    this.RotAreatextBox.Text = spotImageData.spotImageInfo.unFlawArea[1].ToString();
                        //    this.RotNumtextBox.Text = spotImageData.spotImageInfo.unFlawNum[1].ToString();
                        //    m_rotHeight = 3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2;
                        //}
                        imagedata     = new byte[(3 * BackgroundLength + spotImageData.imageInfo.height * 2) * spotImageData.imageInfo.width * 2];
                        m_rotimageRGB = new byte[(3 * BackgroundLength + spotImageData.imageInfo.height * 2) * spotImageData.imageInfo.width * 4];
                        Array.Copy(spotImageData.imagedataC, 0, imagedata, BackgroundLength * spotImageData.imageInfo.width * 2, spotImageData.imageInfo.width * spotImageData.imageInfo.height * 2);
                        if (spotImageData.imagedataC.Length > 0)
                        {
                            Array.Copy(spotImageData.imagedataC, 0, imagedata, (2 * BackgroundLength + spotImageData.imageInfo.height) * spotImageData.imageInfo.width * 2, spotImageData.imageInfo.width * spotImageData.imageInfo.height * 2);
                        }
                        Commonfunction.YUV422ChangeToRGB(imagedata, ref m_rotimageRGB, spotImageData.imageInfo.width, 3 * BackgroundLength + spotImageData.imageInfo.height * 2);
                        this.RotAreatextBox.Text = spotImageData.imageInfo.unFlawArea.ToString();
                        this.RotNumtextBox.Text  = spotImageData.imageInfo.unFlawNum.ToString();
                        m_rotHeight = 3 * BackgroundLength + spotImageData.imageInfo.height * 2;
                        m_rotWidth  = spotImageData.imageInfo.width;

                        m_RotDrawImage = true;
                        this.RotpictureBox.Invalidate();
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine("QualityParamSetForm-RotSetFormt中函数OnUpRotImageInfo出错" + ex);
#if REALEASE
                GlobalDataInterface.WriteErrorInfo("QualityParamSetForm-RotSetFormt中函数OnUpRotImageInfo出错" + ex);
#endif
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 上传图像显示刷新
        /// </summary>
        /// <param name="imageInfo"></param>
        public void OnUpSpotImageData(stSpliceImageData spotImageData)
        {
            try
            {
                if (this == Form.ActiveForm)
                {
                    if (this.InvokeRequired)
                    {
                        this.BeginInvoke(new GlobalDataInterface.SpotImageDataEventHandler(OnUpSpotImageData), spotImageData);
                    }
                    else
                    {
                        if (spotImageData.imageInfo.nRouteId != m_FlawCurrentIPM_ID)
                        {
                            return;
                        }
                        byte[] imagedata;

                        if (spotImageData.imageInfo.width == 0 && spotImageData.imageInfo.height == 0)    //2015.9.30 ivycc
                        {
                            return;
                        }
                        //获取图片
                        //if (Commonfunction.ChanelInIPMIndex(m_ChanelIDList[m_CurrentFlawChannelIndex]) == 0)
                        //{
                        //    imagedata = new byte[(3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2) * spotImageData.spotImageInfo.width * 2];
                        //    m_flawimageRGB = new byte[(3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2) * spotImageData.spotImageInfo.width * 4];
                        //    Array.Copy(spotImageData.imagedataC, spotImageData.spotImageInfo.nTop[0] * spotImageData.spotImageInfo.width * 2, imagedata, BackgroundLength * spotImageData.spotImageInfo.width * 2, spotImageData.spotImageInfo.width * (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2);
                        //    if (spotImageData.imagedataIR.Length > 0)
                        //    {
                        //        Array.Copy(spotImageData.imagedataIR, spotImageData.spotImageInfo.nTop[0] * spotImageData.spotImageInfo.width * 2, imagedata, (2 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0])) * spotImageData.spotImageInfo.width * 2, spotImageData.spotImageInfo.width * (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2);
                        //    }
                        //    Commonfunction.YUV422ChangeToRGB(imagedata, ref m_flawimageRGB, spotImageData.spotImageInfo.width, 3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2);
                        //    this.FlawAreatextBox.Text = spotImageData.spotImageInfo.unFlawArea[0].ToString();
                        //    this.FlawNumtextBox.Text = spotImageData.spotImageInfo.unFlawNum[0].ToString();
                        //    m_height = 3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[0] - spotImageData.spotImageInfo.nTop[0]) * 2;
                        //}
                        //else
                        //{
                        //    imagedata = new byte[(3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2) * spotImageData.spotImageInfo.width * 2];
                        //    m_flawimageRGB = new byte[(3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2) * spotImageData.spotImageInfo.width * 4];
                        //    Array.Copy(spotImageData.imagedataC, spotImageData.spotImageInfo.nTop[1] * spotImageData.spotImageInfo.width * 2, imagedata, BackgroundLength * spotImageData.spotImageInfo.width * 2, spotImageData.spotImageInfo.width * (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2);
                        //    if (spotImageData.imagedataIR.Length > 0)
                        //    {
                        //        Array.Copy(spotImageData.imagedataIR, spotImageData.spotImageInfo.nTop[1] * spotImageData.spotImageInfo.width * 2, imagedata, (2 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1])) * spotImageData.spotImageInfo.width * 2, spotImageData.spotImageInfo.width * (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2);
                        //    }
                        //    Commonfunction.YUV422ChangeToRGB(imagedata, ref m_flawimageRGB, spotImageData.spotImageInfo.width, 3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2);
                        //    this.FlawAreatextBox.Text = spotImageData.spotImageInfo.unFlawArea[1].ToString();
                        //    this.FlawNumtextBox.Text = spotImageData.spotImageInfo.unFlawNum[1].ToString();
                        //    m_height = 3 * BackgroundLength + (spotImageData.spotImageInfo.nBottom[1] - spotImageData.spotImageInfo.nTop[1]) * 2;
                        //}
                        m_flawimageRGB = new byte[(3 * BackgroundLength + spotImageData.imageInfo.height) * spotImageData.imageInfo.width * 3];
                        imagedata      = new byte[(3 * BackgroundLength + spotImageData.imageInfo.height) * spotImageData.imageInfo.width * 2];

                        Array.Copy(spotImageData.imagedataC, 0, imagedata, BackgroundLength * spotImageData.imageInfo.width * 2, spotImageData.imageInfo.width * spotImageData.imageInfo.height * 2);
                        Commonfunction.YUV422ChangeToRGB24(imagedata, ref m_flawimageRGB, spotImageData.imageInfo.width, 3 * BackgroundLength + spotImageData.imageInfo.height);
                        m_height = 3 * BackgroundLength + spotImageData.imageInfo.height;

                        //if (m_cameraIndex == 0)
                        //{
                        //    imagedata = new byte[(3 * BackgroundLength + spotImageData.imageInfo.height) * spotImageData.imageInfo.width * 2];

                        //    Array.Copy(spotImageData.imagedataC, 0, imagedata, BackgroundLength * spotImageData.imageInfo.width * 2, spotImageData.imageInfo.width * spotImageData.imageInfo.height * 2);
                        //    //if (spotImageData.imagedataIR.Length > 0)
                        //    //{
                        //    //    Array.Copy(spotImageData.imagedataIR, 0, imagedata, (2 * BackgroundLength + spotImageData.imageInfo.height) * spotImageData.imageInfo.width * 2, spotImageData.imageInfo.width * spotImageData.imageInfo.height * 2);
                        //    //}
                        //    Commonfunction.YUV422ChangeToRGB24(imagedata, ref m_flawimageRGB, spotImageData.imageInfo.width, 3 * BackgroundLength + spotImageData.imageInfo.height);
                        //    m_height = 3 * BackgroundLength + spotImageData.imageInfo.height;
                        //}
                        //else
                        //{
                        //    imagedata = new byte[(3 * BackgroundLength + spotImageData.imageInfo.height) * spotImageData.imageInfo.width];
                        //    Array.Copy(spotImageData.imagedataC, 0, imagedata, BackgroundLength * spotImageData.imageInfo.width * 2, spotImageData.imageInfo.width * spotImageData.imageInfo.height);
                        //    //if (spotImageData.imagedataIR.Length > 0)
                        //    //{
                        //    //    Array.Copy(spotImageData.imagedataIR, 0, imagedata, (2 * BackgroundLength + spotImageData.imageInfo.height) * spotImageData.imageInfo.width * 2, spotImageData.imageInfo.width * spotImageData.imageInfo.height);
                        //    //}
                        //    Commonfunction.YUV422GrayChangeToRGB24(imagedata, ref m_flawimageRGB, spotImageData.imageInfo.width, 3 * BackgroundLength + spotImageData.imageInfo.height);
                        //    m_height = 3 * BackgroundLength + spotImageData.imageInfo.height;
                        //}
                        this.FlawAreatextBox.Text = spotImageData.imageInfo.unFlawArea.ToString();
                        this.FlawNumtextBox.Text  = spotImageData.imageInfo.unFlawNum.ToString();

                        m_width = spotImageData.imageInfo.width;

                        // Graphics graphics = this.FlawpictureBox.CreateGraphics();//创建画板
                        //Image image;
                        m_FlawDrawImage = true;
                        this.FlawpictureBox.Invalidate();
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine("QualityParamSetForm-FlawSeFormt中函数OnUpimageInfo出错" + ex);
#if REALEASE
                GlobalDataInterface.WriteErrorInfo("QualityParamSetForm-FlawSeFormt中函数OnUpimageInfo出错" + ex);
#endif
            }
        }