예제 #1
0
 private void pictureList1_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (picLstResults.SelectedItem == null)
         {
             return;
         }
         picQView.Image.Dispose();
         picQView.Image = null;
         picLstResults.SelectedItem.Image.Dispose();
         picLstResults.SelectedItem.Image = null;
         frmViewImage frmView = new frmViewImage(
             picLstResults.SelectedItem.Tag.ToString(),
             (imageRecord)picLstResults.SelectedItem.Value,
             this.DBC, "modify");
         if (frmView.ShowDialog() == DialogResult.OK)
         {
             picLstResults.SelectedItem.Image = new Bitmap(picLstResults.SelectedItem.Tag.ToString());
         }
         else
         {
             picLstResults.SelectedItem.Image = new Bitmap(picLstResults.SelectedItem.Tag.ToString());
         }
         picQView.Load(picLstResults.SelectedItem.Tag.ToString());
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             ex.Message,
             "Error in Viewing Image", MessageBoxButtons.OK,
             MessageBoxIcon.Error);
     }
 }
예제 #2
0
 private void rbnBtnManipulate_Click(object sender, EventArgs e)
 {
     try
     {
         picQView.Image.Dispose();
         picQView.Image = null;
         picLstSerImage.SelectedItem.Image.Dispose();
         picLstSerImage.SelectedItem.Image = null;
         frmViewImage frmView = new frmViewImage(
             picLstSerImage.SelectedItem.Tag.ToString(),
             (imageRecord)picLstSerImage.SelectedItem.Value,
             this.DBC, opr);
         if (frmView.ShowDialog() == DialogResult.OK)
         {
             picLstSerImage.SelectedItem.Image = new Bitmap(picLstSerImage.SelectedItem.Tag.ToString());
         }
         else
         {
             picLstSerImage.SelectedItem.Image = new Bitmap(picLstSerImage.SelectedItem.Tag.ToString());
         }
         picQView.Load(picLstSerImage.SelectedItem.Tag.ToString());
         if (opr.ToLower() == "modify")
         {
             picLstSerImage.SelectedItem.Text += " changed";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             ex.Message,
             "Error in Viewing Image", MessageBoxButtons.OK,
             MessageBoxIcon.Error);
     }
 }