将图像添加到图像列表
ImageList = New List(Of System.Drawing.Image)
Using stream As IO.FileStream = File.Open(ThumbFilePath, IO.FileMode.Create)
Dim formatter As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
formatter.Serialize(stream, ImageList)
stream.Flush()
stream.Close()
End Using
因此,当我从流中进行反序列化检索图像列表时,image.tag无效。我认为该标签甚至根本没有序列化。 有什么办法可以将标签信息与每个图像一起保存在列表中,并对其进行序列化以在以后进行检索?
答案 0 :(得分:0)
反序列化:
Using stream As IO.FileStream = IO.File.Open(ThumbFilePath, IO.FileMode.Open, IO.FileAccess.Read)
Dim formatter As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
ImageList = CType(formatter.Deserialize(stream), List(Of System.Drawing.Image))
End Using