/// <summary> /// Sets the default image /// </summary> public void SetImage(Bitmap img) { reset(); if (img_org != null) { img_org.Dispose(); } if (img_display != null) { img_display.Dispose(); } img_org = img; img_gray = new Frame(img); Imaging.EqualizeHist(img_gray); img_display = img_gray.GetBitmap(); using (var gr = CreateGraphics()) AutoScrollMinSize = new Size(img.Width, img.Height); Invalidate(); }