MemoryStream.CopyTo Not working

后端 未结 3 656
独厮守ぢ
独厮守ぢ 2021-01-08 00:38
TiffBitmapDecoder decoder = new TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);

using (MemoryStream allFra         


        
3条回答
  •  生来不讨喜
    2021-01-08 01:14

    Reset Position of ms to 0 after you fill it:

    enc.Save(ms);
    ms.Position = 0;
    ms.CopyTo(allFrameStream);
    

    From Stream.CopyTo

    Copying begins at the current position in the current stream

提交回复
热议问题