//////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Method: On Paint. /// </summary> /// <param name="e"> The Paint Event arguments e.</param> //////////////////////////////////////////////////////////////////////////////////////////////////////////////// protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (DesignMode) { return; } _preview.ShowBuffer(e.Graphics, _scanner, ClientSize, VScrollValue + 1, HScrollValue, ZoomValue, Selection); SetScrollRange(_preview.RowColSize); //long totalMemory = GC.GetTotalMemory(false); //var after = (totalMemory - _mem); //_mem = totalMemory; var bounds = this.ClientRectangle; if (this.Focused) { bounds.Inflate(-3, -3); ControlPaint.DrawFocusRectangle(e.Graphics, bounds); } }