只是图片格式不一!
有*.png、gif、jpg多种格!
winform程序! 别发asp.net的东西来!
DataGridViewImageColumn image = new DataGridViewImageColumn();
image.ImageLayout = DataGridViewImageCellLayout.Zoom;
image.HeaderText = "图片描述";
image.Name = "图片描述";
image.Width = 80;
this.dgview_Lesson.Columns.Add(image);
for (int i = 0; i < this.dgview_Lesson.Rows.Count; i++)
{
L_Lesson Info = Lessonlist[i] as L_Lesson;
if (System.IO.File.Exists(Path.GetDirectoryName(Application.ExecutablePath) + "\\Lesson\\" +
Path.GetFileName(Info._Image.ToString())))
{
this.dgview_Lesson["图片描述", i].Value = Image.FromFile(Path.GetDirectoryName(
Application.ExecutablePath) + "\\Lesson\\" + Path.GetFileName(Info._Image.ToString()));
}
}
显示出来全是差差!