コード例 #1
0
ファイル: Form1.cs プロジェクト: dreamerhuming/DIP
 public MainForm()
 {
     InitializeComponent();
     isZoomAll   = false;
     needZoomOut = true;
     try { imageName = Application.StartupPath + "\\lena.bmp"; }
     catch (System.Exception ex) { };
     myImage.readImage(imageName);
     this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.panel_MouseWheel);
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: dreamerhuming/DIP
 private void openImage()
 {
     if (myImage == null)
     {
         myImage = new imageClass();
         myImage.readImage(Application.StartupPath + "\\lena.bmp");
     }
     else
     {
         openFileDialog1.Filter      = "Bitmap Image|*.bmp";
         openFileDialog1.FilterIndex = 0;
         openFileDialog1.Title       = "Choose a bit map";
         if (openFileDialog1.ShowDialog() == DialogResult.OK)
         {
             imageName = openFileDialog1.FileName;
             myImage.readImage(imageName);
         }
         if (openFileDialog1.FileName == "")
         {
             return;
         }
     }
     panel.Refresh();
     if (histForm != null)
     {
         myImage.HistCalculation();
         histForm.getIndex = this.myImage;
         histForm.Refresh();
     }
     if (gTransForm != null)
     {
         myImage.HistCalculation();
         gTransForm.getIndex = this.myImage;
         gTransForm.Refresh();
     }
 }