从 Windows.Media.DrawingImage 转换为 Windows.Media.Imaging.BitMapImage 或 Windows.Media.ImageSource

发布于 2024-11-28 00:11:32 字数 228 浏览 2 评论 0原文

我在从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

找个人就嫁了吧 2024-12-05 00:11:33

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文