I need to load around 70-100 images on datagridview (DatagridviewImageColumn) and I can do it but only loads 33 and then I get: "System out of memory exception" Memoria insuficiente.
The images have high resolution (1600x2700). My code is:
If FolderBrowserDialog1.ShowDialog = DialogResult.OK Then
For Each Documento As String In My.Computer.FileSystem.GetFiles(FolderBrowserDialog1.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly)
*Dim imagen As Image = Image.FromFile(Documento)
DataGridView1.Rows(a).Cells(0).value = imagen
a = a + 1
Next
End If
The error points to line with (*)
I also tried with delays (Threading.Thread.Sleep(3500)) and Through Timer with interval of 3500 but I still get the same error.
What can I do?
Thanks.