BitmapEncoder/ decoder, memory stream and NotSupportedException c# .net -



BitmapEncoder/ decoder, memory stream and NotSupportedException c# .net -

i have next code:

memorystream imagestream; public imagevideoframe(bitmapsource frame) { imagestream = new memorystream(); bitmapencoder encoder = new pngbitmapencoder(); encoder.frames.add(bitmapframe.create(frame)); encoder.save(imagestream); imagestream.seek(0, seekorigin.begin); } public bitmapsource frame { bitmapdecoder decoder = new pngbitmapdecoder(image, bitmapcreateoptions.none, bitmapcacheoption.onload); bitmapsource bitmapsource = decoder.frames.first(); homecoming bitmapsource; }

used compress images in memory cut down memory usage. problem above code notsupportedexcpetion constructing pngbitmapdecoder. when debugging position of imagestream shown be

c# .net visual-studio memorystream

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -