1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| if (e.ColumnIndex == 0)
{
Image ey = Properties.Resources.Eye;
e.PaintBackground(e.ClipBounds, false);
Point pt = e.CellBounds.Location;
int offset = (e.CellBounds.Width - ey.Size.Width) / 2;
pt.X += offset;
pt.Y += 1;
e.Graphics.DrawImage(ey, pt);
e.Handled = true;
}
else if ( e.ColumnIndex == 2)
{
Image ey = Properties.Resources.Rainbow2;
e.PaintBackground(e.ClipBounds, false);
Point pt = e.CellBounds.Location;
int offset = (e.CellBounds.Width - ey.Size.Width) / 2;
pt.X += offset;
pt.Y += 1;
Rectangle R = new Rectangle(0, 0, ey.Size.Width, ey.Size.Height);
e.Graphics.DrawImage(ey,e.CellBounds,R,GraphicsUnit.Pixel);
e.Handled = true;
} |
Partager