2

我想使用 WP8 上的 Nokia Imaging 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。

我该如何解决这个问题?

4

1 回答 1

4

您是否尝试过使用 StorageFileImageSource?

string imageFile = @"images\background.jpg"
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);
blendFilter.ForegroundSource = new StorageFileImageSource(file))
于 2013-12-14T18:00:51.967 回答