上面的实现效果:
实现代码:
- Image backGroundImage;
- public void New()
- {
- backGroundImage = Image.FromFile(@"../../bg2.jpg");
- }
- protected override void PaintBackground(Graphics graphics, Rectangle clipBounds, Rectangle gridBounds)
- {
- base.PaintBackground(graphics, clipBounds, gridBounds);
- graphics.DrawImage(backGroundImage, gridBounds);
- }