我有一个图像列表,并想在我的代码中将图像目录添加到图像列表中。我该怎么做?当我运行代码时:
'Load all of the items from the imagelist
For Each path As String In Directory.GetFiles("Images\LanguageIcons\")
imlLanguagesIcons.Images.Add(Image.FromFile(path))
Next
Run Code Online (Sandbox Code Playgroud)
我收到内存不足的异常。目前只有14张图片,因此应该没有问题。有帮助吗?