I want to store tiff images in a List (more than 100 frames) as bytes. I am using TiffBitmapDecoder to decode the tiff file and converting & storing each frame as bytes in the List. It throws System.OutOfMemoryException in between, I could not handle this!! Is there any way to store the large image in memory? Thanks.
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