I may not fully understand the question, but here is one method to display an image dynamically (in code):
I assume that you have an Image control defined somewhere where you want to display the thumbnail? In this example, I have this defined in XAML:
Code:
<Image x:Name="image" />
I have an image saved to disk that I load into memory by doing the following:
Code:
FileInfo fileInf = new FileInfo("out.png");
byte[] imageBytes = File.ReadAllBytes(fileInf.FullName);
Then, when I want to display the image I do the following:
Code:
using (MemoryStream ms = new MemoryStream(imageBytes))
{
BitmapImage img = new BitmapImage();
img.BeginInit();
img.CacheOption = BitmapCacheOption.OnLoad;
img.StreamSource = ms;
img.EndInit();
this.image.Source = img;
}