public ImageBox()
{
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.StandardDoubleClick, false);
_vScrollBar = new VScrollBar
{
Visible = false
};
// ReSharper disable once HeapView.DelegateAllocation
_vScrollBar.Scroll += ScrollBarScrollHandler;
_hScrollBar = new HScrollBar
{
Visible = false
};
// ReSharper disable once HeapView.DelegateAllocation
_hScrollBar.Scroll += ScrollBarScrollHandler;
Controls.Add(_vScrollBar);
Controls.Add(_hScrollBar);
HorizontalScroll = new ImageBoxScrollProperties(_hScrollBar);
VerticalScroll = new ImageBoxScrollProperties(_vScrollBar);
// ReSharper disable DoNotCallOverridableMethodsInConstructor
BorderStyle = BorderStyle.Fixed3D;
AllowZoom = true;
LimitSelectionToImage = true;
DropShadowSize = 3;
ImageBorderStyle = ImageBoxBorderStyle.None;
BackColor = Color.White;
AutoSize = false;
GridScale = ImageBoxGridScale.Small;
GridDisplayMode = ImageBoxGridDisplayMode.Client;
GridColor = Color.Gainsboro;
GridColorAlternate = Color.White;
GridCellSize = 8;
AutoPan = true;
InterpolationMode = InterpolationMode.NearestNeighbor;
AutoCenter = true;
SelectionColor = SystemColors.Highlight;
ActualSize();
ShortcutsEnabled = true;
ZoomLevels = ImageBoxZoomLevelCollection.Default;
ImageBorderColor = SystemColors.ControlDark;
PixelGridColor = Color.DimGray;
PixelGridThreshold = 5;
TextAlign = ContentAlignment.MiddleCenter;
TextBackColor = Color.Transparent;
TextDisplayMode = ImageBoxGridDisplayMode.Client;
// ReSharper restore DoNotCallOverridableMethodsInConstructor
}