2
是否可以在DataGridViewImageColumn的列中显示多个图像?我只有1列,需要动态显示图像。根据其他条件,该列可以显示1到3张图像。在DataGridView图像列中显示多个图像?可能吗?
是否可以在DataGridViewImageColumn的列中显示多个图像?我只有1列,需要动态显示图像。根据其他条件,该列可以显示1到3张图像。在DataGridView图像列中显示多个图像?可能吗?
您可以将要显示的两幅图像绘制到第三张新图像上,然后将其显示在列中。
事情是这样的:
Bitmap Image1 = new Bitmap(10, 10); //replace with your first image
Bitmap Image2 = new Bitmap(10, 10); //replace with your second image
Bitmap ImageToDisplayInColumn = new Bitmap(Image1.Width + Image2.Width, Image1.Height);
using (Graphics graphicsObject = Graphics.FromImage(ImageToDisplayInColumn))
{
graphicsObject.DrawImage(Image1, new Point(0, 0));
graphicsObject.DrawImage(Image2, new Point(Image1.Width, 0));
}
有几篇关于创建自定义DataGridViewColumns的文章。这里有一个来自CODE magazine。这听起来像你想写你自己的代码来绘制与适当的图像或图像列。
+1非常有用链接 – Kamil 2013-03-03 17:26:21