【问题标题】:fill datagridview column with images from image path column用图像路径列中的图像填充 datagridview 列
【发布时间】:2012-04-07 06:41:07
【问题描述】:

我有带有字段的 Access 表,其中有一些数据和图像路径。 我创建了DataGridViewImageColumn,然后我不知道如何从某个路径加载一些图像,以及如何使用它。 这是表格 http://imageshack.us/photo/my-images/833/97095287.jpg/

带有路径的字段是隐藏的,你看,有一些图像列

【问题讨论】:

  • 张贴的表格图片,还有什么?

标签: c# image datagridview


【解决方案1】:

这里是如何将图像放入 DataGridViewImageColumn 的单元格中的示例代码

  private void createGraphicsColumn()
    {
        Icon treeIcon = new Icon(this.GetType(), "tree.ico");
        DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
        iconColumn.Image = treeIcon.ToBitmap();
        iconColumn.Name = "Tree";
        iconColumn.HeaderText = "Nice tree";
        dataGridView1.Columns.Insert(2, iconColumn);
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-12
    • 2011-07-30
    • 2011-04-17
    相关资源
    最近更新 更多