博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
wpf 解决 编码解码器无法使用提供的流类型 The codec cannot use the type of stream provided...
阅读量:4663 次
发布时间:2019-06-09

本文共 652 字,大约阅读时间需要 2 分钟。

之前做的ListBox里列大图

图片转换的时候这段代码

有的时候会有问题 编码解码器无法使用提供的流类型 或者 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;

 

  

 

 

 

 

转载于:https://www.cnblogs.com/li-peng/archive/2012/11/20/2779304.html

你可能感兴趣的文章
Go学习笔记(3)字符串
查看>>
挑战编程题(三)
查看>>
Linux下的crontab定时执行任务命令详解
查看>>
iOS开发init方法解析
查看>>
ValueListEdit控件的用法
查看>>
Python的主成分分析PCA算法
查看>>
day04-Linux系统中用户控制及文件权限管理方法
查看>>
go语言操作mongodb
查看>>
java定时器的使用
查看>>
es6学习笔记
查看>>
PAT 1043. 输出PATest
查看>>
Angular4 后台管理系统搭建(6) - 和D3.js V4版本结合画图
查看>>
《DSP using MATLAB》Problem 5.31
查看>>
HttpWebRequest解析 作用 介绍
查看>>
阿里云 centos vim 显示中文 乱码
查看>>
《DSP using MATLAB》示例Example7.24
查看>>
第一阶段——站立会议总结DAY01
查看>>
结合使用 Oracle Database 11g 和 Python
查看>>
C C++ 去除 unused的提示
查看>>
STL Algorithms 之 unique
查看>>