Notifications
Clear all

[Closed] Adding array of images to datagridview

I have an array of bitmaps that I would like to add to a datagridview’s image columns.

Would I need to convert this image array into a .net imagelist first?

The images are all the same size and presampled to the size I want them to appear in the gridview.

What would be the general process to populate the columns with these thumbnails? Any thoughts suggestions really appreciated.

Cheers,

D.

2 Replies

The array doesn’t have to be a .net imagelist but the images have to be in the form of .net system.drawing.image. If you have the images saved to disk use:

image = (dotnetclass "System.Drawing.Image").fromfile fileName

Then to populate the cells set the value of the cell to the image:

dgv.rows.item[rowI].cells.item[colI].value

where rowI and colI are your row and column indices (which are 0 based).

Thanks for the response, this seems to have done the trick.