//////////////////////////////////////////////////////////////////////////**********20141204 //双击表格时弹出图像 private void dataGridView_editTable_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { string strImageName = dataGridView_editTable.SelectedRows[0].Cells[12].Value.ToString(); //得到照片名称 if (m_isfForm != null) { m_isfForm.Close(); m_isfForm = null; } if (File.Exists("Photos\\" + strImageName)) { m_isfForm = new ImageShowForm("Photos\\" + strImageName); m_isfForm.ControlBox = true; m_isfForm.TopMost = false; m_isfForm.Show(); } else { MessageBox.Show(" 照片不存在! \n\n 请确认Photos文件夹位于应用程序目录下! "); } }
//////////////////////////////////////////////////////////////////////////**********20141204 //JS调用WinForm显示标志牌图像 public void JsCallCSharp_ShowImage(string strImageName) { if (!m_IsLoadImageAutomatically) { return; } JsCallCSharp_CloseImage(); string strPrefix = strImageName.Split(new char[] { '_' })[0]; foreach (string item in Directory.GetFiles("Photos", "*.jpg")) { if (item.Replace("Photos\\", "").StartsWith(strPrefix)) { m_img2ShowList.Add(item); } } foreach (string strpath in m_img2ShowList) { if (File.Exists(strpath)) { ImageShowForm isf = new ImageShowForm(strpath); m_form2ShowImageList.Add(isf); } else { MessageBox.Show(" 照片不存在! \n\n 请确认Photos文件夹位于应用程序目录下! "); } } foreach (ImageShowForm isf in m_form2ShowImageList) { isf.Show(); } }