Posted 7 July 2021, 10:02 pm EST
I am trying to load BitMap images(several small ones) to a column in a datatable (C#) which is later binded with Far point spread.
I have created the new column in Datatable as: ``` Table.Columns.Add(“Level”, typeof(System.Byte));
I have also tried : ``` Table.Columns.Add("Level", typeof(System.Drawing.Bitmap));
and I have the image pulled at runtime as: ‘frmBitmap.DefInstance.imgDynamic.Images[sBitmap]’ where sBitmap is some string which pulls the specific image from the ‘imgDynamic’ ImageList. The type of the image is: System.Drawing.Bitmap
But when I assign this image i.e., frmBitmap.DefInstance.imgDynamic.Images[sBitmap] to column field, I don’t see the image instead I see ‘System.Byte’ as ouput. I have tried setting up tne BitMap image to datatable as:
var imageConverter = new ImageConverter(); Table.Rows["Level"] = imageConverter.ConvertTo(frmBitmap.DefInstance.imgDynamic.Images[sBitmap], System.Type.GetType("System.Byte"));
My Question is: How Exactly can we load the BITMAP image in a column in datatable in C#???