Reputation: 2208
How do I convert a Image stream from the Picture to an imagesource?
Im using this
MediaLibrary library = new MediaLibrary();
foreach (Picture Alb in library.Pictures)
{
Z.ImageSource = Alb.GetImage();
}
Upvotes: 0
Views: 1106
Reputation: 65586
You'll need to turn the stream into an image to use it.
I'm not sure what z
is in your example.
So, assuming you just wanted one image:
<Image x:Name="z" />
You could do:
var library = new MediaLibrary();
var picStream = library.Pictures.First();
var img = new BitmapImage();
img.SetSource(picStream.GetImage());
z.Source = img;
Upvotes: 1