public Form1() { InitializeComponent(); image = (Bitmap)pictureBox1.Image; imageHandler imgHndl = new imageHandler(); imgHndl.extractClourChannels(image); red = imgHndl.getRed(); blue = imgHndl.getBlue(); green = imgHndl.getGreen(); BnW = imgHndl.getBnW(); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { imagePath.Filter = "Bitmap Image (.bmp)|*.bmp|Gif Image (.gif)|*.gif|JPEG Image (.jpeg)|*.jpeg|JPG Image (.jpg)|*.jpg|Png Image (.png)|*.png|Tiff Image (.tiff)|*.tiff|Wmf Image (.wmf)|*.wmf"; if (imagePath.ShowDialog() == DialogResult.OK) { image = (Bitmap)Bitmap.FromFile(imagePath.FileName); pictureBox1.Image = (Bitmap)image.Clone(); pictureBox2.Image = (Bitmap)image.Clone(); imageHandler imgHndl = new imageHandler(); imgHndl.extractClourChannels(image); //Image is seperated into colour channels when the image is loading red = imgHndl.getRed(); blue = imgHndl.getBlue(); green = imgHndl.getGreen(); BnW = imgHndl.getBnW(); //listBox2.Items.Clear(); ImageInfo info = new ImageInfo((Bitmap)image.Clone(), imagePath.FileName); info.Show(); // meta(); } }