Example #1
0
 private void but_add_Click(object sender, EventArgs e)
 {
     try
     {
         if (IsNumber(txt_page.Text) == false)
         {
             MessageBox.Show("输入页码错误!");
             return;
         }
         NewFile = Path.Combine(@"c:\temp\", LoadPage.ToString() + ".jpg");
         if (File.Exists(NewFile) == true)
         {
             File.Delete(NewFile);
         }
         Hlimage._ImgPj(LoadPage, SourFile, NewFile);
         if (pic1.Image == null)
         {
             pic1.Image   = Image.FromFile(NewFile);
             pic1.Visible = true;
             Page1        = LoadPage;
             return;
         }
         else if (pic2.Image == null)
         {
             pic2.Image   = Image.FromFile(NewFile);
             pic2.Visible = true;
             Page2        = LoadPage;
             return;
         }
         MessageBox.Show("无法添加新的图像!");
         return;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }