protected virtual void DrawBackground(PaintEventArgs e)
{
Rectangle innerRectangle;
innerRectangle = GetInsideViewPort();
using (SolidBrush brush = new SolidBrush(BackColor))
{
e.Graphics.FillRectangle(brush, innerRectangle);
}
if (_texture != null && GridDisplayMode != ImageBoxGridDisplayMode.None)
{
switch (GridDisplayMode)
{
case ImageBoxGridDisplayMode.Image:
Rectangle fillRectangle;
fillRectangle = GetImageViewPort();
e.Graphics.FillRectangle(_texture, fillRectangle);
break;
case ImageBoxGridDisplayMode.Client:
e.Graphics.FillRectangle(_texture, innerRectangle);
break;
}
}
}