您的位置:首页 > 其它

wpf 解决 编码解码器无法使用提供的流类型 The codec cannot use the type of stream provided

2012-11-20 16:49 525 查看
之前做的ListBox里列大图/article/4902649.html

图片转换的时候这段代码



有的时候会有问题 编码解码器无法使用提供的流类型 或者 The codec cannot use the type of stream provided

改成

BitmapImage bitImage = new BitmapImage();
bitImage.BeginInit();
bitImage.StreamSource = imageStreamSource;
bitImage.EndInit();
//JpegBitmapDecoder jpeDecoder=new JpegBitmapDecoder(imageStreamSource,BitmapCreateOptions.PreservePixelFormat,BitmapCacheOption.OnLoad);
//ImageSource imageSource=jpeDecoder.Frames[0];
ImageSource imageSource = bitImage;
return imageSource;


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐