public UOPPanel(Bitmap image, Image_Panel caller) { InitializeComponent(); this.caller = caller; originalImage = image; BasicImageOpertions = new BasicImageOpertions(originalImage); BasicImageOpertions.ToGreyScale(); secondaryImage = (Bitmap)originalImage.Clone(); this.pctbImage.Image = secondaryImage; hist = new ImageHistogram((Bitmap)pctbImage.Image); hist.CreateChart(this.chHisto); this.pctbUOP.Image = new Bitmap(256, 256); grafika = Graphics.FromImage(pctbUOP.Image); LUT = new int[256]; linia = new Krzywa(); RysujLinie(); }
private void btnOK_Click(object sender, EventArgs e) { if (cmbFirstImage.SelectedItem != null && cmbSecondImage.SelectedItem != null) { Bitmap bmp1 = bitmaps[(string)cmbFirstImage.SelectedItem]; Bitmap bmp2 = new Bitmap((Bitmap)bitmaps[(string)cmbSecondImage.SelectedItem], bmp1.Width, bmp1.Height);//(Bitmap)bitmaps[(string)cmbSecondImage.SelectedItem].Clone(); //resultBmp = (Bitmap)bmp1.Clone(); operationOnImage = new BasicImageOpertions(bmp2); operationOnImage.ToGreyScale(); operationOnImage = new BasicImageOpertions(bmp1); if (rdbAdd.Checked) { operationOnImage.ADD(bmp2); } else if (rdbSub.Checked) { operationOnImage.SUB(bmp2); } else if (rdbDiff.Checked) { operationOnImage.DIFF(bmp2); } else if (rdbOR.Checked) { operationOnImage.OR(bmp2); } else if (rdbAND.Checked) { operationOnImage.AND(bmp2); } else if (rdbXOR.Checked) { operationOnImage.XOR(bmp2); } //else if (radioButtonAnd.Checked) And(bmp1, bmp2); //else if (radioButtonOr.Checked) Or(bmp1, bmp2); //else if (radioButtonXor.Checked) Xor(bmp1, bmp2); } foreach (Image_Panel form in forms) { form.Refresh(); form.RemakeHistogram(); } this.Close(); }
private void toGrayscaleToolStripMenuItem_Click(object sender, EventArgs e) { basicImageOpertions.ToGreyScale(); SetImageAndHist((Bitmap)pctbImage.Image); }