/// <summary> /// 图片点击 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void pictureBox_Click(object sender, EventArgs e) { PictureBox pictureBox1 = sender as PictureBox; if (pictureBox1.Image != null) { if (fp == null || fp.IsDisposed) { fp = new FrmPView(); } fp.image = pictureBox1.Image; fp.Show(); } }
/// <summary> /// 预览X光报告 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ucTxt_code.Text)) { DirectoryInfo newFolder = new DirectoryInfo(@"D:\uploadFolder\xRayFolder\data\" + ucTxt_code.Text); if (newFolder != null) { FileInfo[] bmpFiles = newFolder.GetFiles("*.bmp"); if (bmpFiles.Length > 0) { string url = @"D:\uploadFolder\xRayFolder\data\" + ucTxt_code.Text + @"\" + bmpFiles[0].Name; if (fp == null || fp.IsDisposed) { fp = new FrmPView(); } fp.image = Image.FromFile(url); fp.Show(); } else { MessageBox.Show("暂无报告!"); } } else { MessageBox.Show("暂无报告!"); } } if (pictureBox1.Image != null) { if (fp == null || fp.IsDisposed) { fp = new FrmPView(); } fp.image = pictureBox1.Image; fp.Show(); } }
private void button1_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(uTxt_checknumber.Text)) { string filePath = Application.StartupPath; DirectoryInfo newFolder = new DirectoryInfo(filePath + @"\xRayFolder\data\" + uTxt_checknumber.Text); if (newFolder != null && newFolder.Exists) { FileInfo[] bmpFiles = newFolder.GetFiles("*.bmp"); if (bmpFiles.Length > 0) { string url = filePath + @"\xRayFolder\data\" + uTxt_checknumber.Text + @"\" + bmpFiles[0].Name; if (fp == null || fp.IsDisposed) { fp = new FrmPView(); } fp.image = Image.FromFile(url); fp.Show(); } else { MessageBox.Show("暂无报告!"); } } else { MessageBox.Show("暂无报告!"); } } //if (pictureBox1.Image != null) //{ // if (fp == null || fp.IsDisposed) // fp = new FrmPView(); // fp.image = pictureBox1.Image; // fp.Show(); //} }