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