从内容中加载图像作为IImageProvider

本文关键字:IImageProvider 图像 加载 | 更新日期: 2024-09-24 03:36:13

我想使用WP8上的诺基亚成像SDK将两张图像混合在一起。为此,我需要将blendFilter.ForegroundSource设置为从IImageProvider派生的图像类型。我试过使用

Uri uri = new Uri("/images/background.jpg", UriKind.Relative);  
var imgSource = new BitmapImage(uri);
blendFilter.ForegroundSource = new BitmapImageSource(imgSource);

但是BitmapImage不实现IReadableBitmap。

我该如何解决这个问题?

从内容中加载图像作为IImageProvider

您尝试过使用StorageFileImageSource吗?

string imageFile = @"images'background.jpg"
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);
blendFilter.ForegroundSource = new StorageFileImageSource(file))
相关文章:
  • 没有找到相关文章