首页 > Windows开发 > 详细

WPF_图片黑白处理

时间:2015-08-05 21:40:05      阅读:403      评论:0      收藏:0      [点我收藏+]
技术分享
 1    BitmapImage myBitmapImage = new BitmapImage ( );
 2             myBitmapImage . BeginInit ( );
 3             myBitmapImage . UriSource = new Uri ( ImagePath , UriKind . Relative );
 4             myBitmapImage . DecodePixelWidth = 200;
 5             myBitmapImage . EndInit ( );
 6             FormatConvertedBitmap newFormatedBitmapSource = new FormatConvertedBitmap ( );
 7             newFormatedBitmapSource . BeginInit ( );
 8             newFormatedBitmapSource . Source = myBitmapImage;
 9             newFormatedBitmapSource . DestinationFormat = PixelFormats . Gray32Float;
10             newFormatedBitmapSource . EndInit ( );
11             Image myImage = new Image ( );
12             myImage . Width = 200;
13             //set image source
14             myImage . Source = newFormatedBitmapSource;
View Code

 

WPF_图片黑白处理

原文:http://www.cnblogs.com/linbinqiang/p/4705695.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!