2

I'd like to blend two images together using the Nokia Imaging SDK on WP8. For this, I need to set the blendFilter.ForegroundSource to an image type derived from IImageProvider. I tried using

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

but BitmapImage does not implement IReadableBitmap.

How can I solve this?

David Božjak
  • 16,887
  • 18
  • 67
  • 98
Thomas
  • 4,030
  • 4
  • 40
  • 79

1 Answers1

4

Have you tried using StorageFileImageSource?

string imageFile = @"images\background.jpg"
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);
blendFilter.ForegroundSource = new StorageFileImageSource(file))
Igor Ralic
  • 14,975
  • 4
  • 43
  • 51
  • thanks, that's what I was looking for. I keep getting confused by all the image formats, streams etc. – Thomas Dec 14 '13 at 18:45