简体   繁体   English

如何从 BitmapImage 获取 BitmapSource?

[英]How to get BitmapSource from BitmapImage?

How to get BitmapSource from BitmapImage?如何从 BitmapImage 获取 BitmapSource? Or how to convert BitmapImage to BitmapFrame directly?或者如何直接将BitmapImage转换为BitmapFrame? It seems to me that if I have BitmapSource I could use BitmapFrame.Create and finally get BitmapFrame object from given BitmapImage在我看来,如果我有 BitmapSource,我可以使用 BitmapFrame.Create 并最终从给定的 BitmapImage 获取 BitmapFrame 对象

BitmapImage继承自BitmapSource所以不需要转换

The BitmapImage inherits from BitmapSource as parapura said.正如 parapura 所说, BitmapImage继承自BitmapSource

Example:例子:

BitmapSource bitmapSource = new BitmapImage();
BitmapImage bitmapImage = bitmapSource as BitmapImage;

Source: BitmapSource MSDN来源: BitmapSource MSDN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM