我想将tiff图像存储在List(超过100帧)中作为字节。我正在使用TiffBitmapDecoder解码tiff文件并转换&将每个帧作为字节存储在List中。它之间抛出System.OutOfMemoryException,我无法处理这个! 有没有办法将大图像存储在内存中?感谢。
ms = New MemoryStream(File.ReadAllBytes(FilePathName))
tiffbmpdecoderViewerImage = New TiffBitmapDecoder(ms, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
For Each frame As BitmapFrame In tiffbmpdecoderViewerImage.Frames
ms = New MemoryStream
BmpEncoder = New BmpBitmapEncoder
BmpEncoder.Frames.Add(frame)
BmpEncoder.Save(ms)
ByteArrayList.Add(ms.ToArray) //exception
Next
答案 0 :(得分:1)