首页 > 其他 > 详细

MemoryStream转imageSource

时间:2015-11-25 13:25:03      阅读:513      评论:0      收藏:0      [点我收藏+]

// 设置图像控件                     Image image = new Image();                     panel.IsEnabled = false;                     using (MemoryStream ms = new MemoryStream(item.AttachConnect))                     {                       //  var decoder = BitmapDecoder.Create(ms,                       //BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad);                         var imageSource = new BitmapImage();                         imageSource.BeginInit();                         imageSource.StreamSource = ms;                         imageSource.EndInit();

                        // Assign the Source property of your image                         image.Source = imageSource;                     }

MemoryStream转imageSource

原文:http://www.cnblogs.com/gaohao/p/4994170.html

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