本文介绍了转换BitmapImage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个为我输出BitmapImage的DLL,但是我需要一个BitmapFrame.
我尝试使用BitmapFrame.Creat ...无济于事.
有关如何将System.Windows.Media.Imaging.BitmapImage转换为System.Windows.Media.Imaging.BitmapFrame的任何想法?
Hi All,
I have a DLL which outputs a BitmapImage for me, however i need a BitmapFrame.
I''ve tried to use BitmapFrame.Creat... to no avail.
Any ideas on how to convert a System.Windows.Media.Imaging.BitmapImage to System.Windows.Media.Imaging.BitmapFrame?
Thanks in advance!
推荐答案
Stream bmpStream =
new System.IO.FileStream("smiley.bmp", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
BmpBitmapDecoder bmpDecoder =
new BmpBitmapDecoder(bmpStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
BitmapFrame bmpFrame = bmpDecoder.Frames[0];
这篇关于转换BitmapImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!