public override EImageBW8 Run(EImageBW8 img) { if (!Enable) { return(img); } EImageBW8 imgBw8 = new EImageBW8(); imgBw8.SetSize(img); switch (Mode) { case MyThresholdMode.Auto: EBW8 value1 = EasyImage.AutoThreshold(img, EThresholdMode.MinResidue); AbsoluteValue = value1.Value; break; case MyThresholdMode.Absolute: break; case MyThresholdMode.Relative: EBW8 value2 = EasyImage.AutoThreshold(img, EThresholdMode.Relative, RelativeValue); AbsoluteValue = value2.Value; break; default: break; } EasyImage.Threshold(img, imgBw8, AbsoluteValue); img.Dispose(); img = new EImageBW8(); return(imgBw8); }
private void picbox_ToolEdit_MouseMove(object sender, MouseEventArgs e) { if (picbox_ToolEdit.Image != null && !picbox_ToolEdit.Image.IsVoid) { PointF p = picbox_ToolEdit.GetLocation(e); Point p2 = Point.Round(p); toolStripLabel3.Text = p2.ToString(); EBW8 gray = picbox_ToolEdit.GetGaryValue(e); toolStripLabel2.Text = "Gray = " + gray.Value.ToString(); } }