0

I'm trying to use the type JpegBitmapEncoderin the name space System.Windows.Media.Imaging, but i can't seem to use it. The namespace itself is available and i can use it but for some reason the JpegBitmapEncoder is not there... How can i use it?

4

1 回答 1

1

也许您可以使用WritableBitmap上的扩展方法来加载和保存 jpeg。

扩展方法 - LoadJpeg、SaveJpeg

如果要从图像中获取字节数组,请使用 aMemoryStream及其ToArray获取数据。

MemoryStream stream = new MemoryStream();
image.SaveJpeg(stream, width, height, 0, 80);
stream.Position = 0;
byte[] buffer = stream.ToArray();
于 2012-08-22T17:41:37.883 回答