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
            }
        }