Click here to Skip to main content
15,914,608 members

Comments by Pouya Javadzadeh (Top 1 by date)

Pouya Javadzadeh 21-Sep-14 12:01pm View    
Deleted
I used the code above and it throws {"Object reference not set to an instance of an object."} exception. Could you please tell me why ImageSourceConverter cannot convert Bitmap. Here is my code:

System.Drawing.Image bitmapImage = System.Drawing.Bitmap.FromStream(item.GetStream);
System.Windows.Media.ImageSourceConverter imageSourceConverter = new System.Windows.Media.ImageSourceConverter();
System.Windows.Media.ImageSource imageSource = ((System.Windows.Media.ImageSource)(imageSourceConverter.ConvertFrom(bitmapImage)));