从 Windows.Media.DrawingImage 转换为 Windows.Media.Imaging.BitMapImage 或 Windows.Media.ImageSource
我在从 wpf 接收 Windows.Media.DrawingImage 类型的输入时遇到一些麻烦,我需要将其转换为 windows.media.ImageSource 或 windows.media.BitmapImage 以便将它们转换为系统.drawing.bitmap 或 System.drawing.image。
我已经在网上进行了大量搜索,但找不到答案。如果有人能帮助我,我将非常感激,
谢谢!
Am having some trouble that i'm recieving an input from wpf that is of type Windows.Media.DrawingImage and I need to convert it to either windows.media.ImageSource or to windows.media.BitmapImage inorder for me to convert those into System.drawing.bitmap or System.drawing.image.
I have already searched extensively online, but could not find an answer. I would be very graeful if someone were to help me out
thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Windows.Media.DrawingImage 本身就是一个 ImageSource,因此您可以将其设置为任何 Image 类的源...
这是一个示例...http://msdn.microsoft.com/en-us/library/system.windows.media.drawingimage.aspx
因此您可以使用的图像BitmapImage 以及...看到这个...
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/aad606b1-3f64-4314-a552-370afd361926/
这能回答您的问题吗?
Windows.Media.DrawingImage is itself an ImageSource so you can set this as a source to any Image class...
Here is an example .... http://msdn.microsoft.com/en-us/library/system.windows.media.drawingimage.aspx
So instead of Image you can use BitmapImage as well ... see this ...
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/aad606b1-3f64-4314-a552-370afd361926/
Does this answer your question?