/// <summary> /// Raises the <see cref = "E:System.Windows.Forms.Control.EnabledChanged"></see> event. /// </summary> /// <param name = "e">An <see cref = "T:System.EventArgs"></see> that contains the event data.</param> protected override void OnEnabledChanged(EventArgs e) { if (InvokeRequired) { ThreadSafeInvoke d = OnEnabledChanged; Invoke(d, new object[] { e }); return; } base.OnEnabledChanged(e); Invalidate(); }
private void LoadResults(Bitmap bitmap, IComparison comparison) { try { DisposeImages(); var originalBitmap = bitmap; var originalImage = ImageProcessingLibConverter.CreateImageFromBitmap(originalBitmap); Bitmap tempResult = null; var fipTime = ExecTime.Run(() => { tempResult = comparison.GetFIPResults(new FIP.FIP(), originalBitmap); }); var fipBitmap = (Bitmap)tempResult.Clone(); var fipImage = ImageProcessingLibConverter.CreateImageFromBitmap(fipBitmap); Image <Pixel32> iplImage = null; var iplTime = ExecTime.Run(() => { iplImage = comparison.GetIPLResult(originalImage); }); var iplBitmap = ImageProcessingLibConverter.CreateBitmapFromImage(iplImage); ThreadSafeInvoke.Invoke(this, () => { pbFIP.Image = fipBitmap; pbIPL.Image = iplBitmap; tsslInfo.Text = string.Format("MSE: {0:0.00}, IPL: {1:0}ms, FIP: {2:0}ms", GetMetrics(fipImage, iplImage), iplTime.TotalMilliseconds, fipTime.TotalMilliseconds); }); createdBitmaps = new List <Bitmap>() { fipBitmap, iplBitmap }; } catch (Exception e) { MessageBoxEx.ShowException(e); } }