如何获取 Casting Device Icon 并将其转换为 Image 或 BitmapImage?

How to get Casting Device Icon and convert it as Image or BitmapImage?

我喜欢 casting device icon 并将其显示在屏幕上。但我不知道如何做到这一点。 CastingDevice.Icon 可以读作 Stream(不知何故),但如果我想要的结果是 ImageBitmapImage?

,如何读它

CastingDevice.Icon is possible to read as Stream (somehow) but how to read it if I want that result is Image or BitmapImage?

您可以使用 SetSourceAsync(IRandomAccessStream) BitmapImage的方法创建一个BitmapImage对象,然后你就可以使用这个BitmapImage作为Image的Source。