I am referring this Display Images from Database in Windows Phone 7 (WP7) using WCF service to retrieve image from sql server to window phone and had error ArgumentNullException was unhandled when run it at the that higlighted row.
public class ImageConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
byte[] buffer = value as byte[];
**Stream memStream = new MemoryStream(buffer);**
WriteableBitmap wbimg = PictureDecoder.DecodeJpeg(memStream);
return wbimg;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
}
I had found another similar post had same error with me. System.ArgumentException was unhandled Message=The parameter is incorrect. - App Hub ForumsBut don't understand the coding..Anyone know how to solve the error? Or any other reference for me to retrieve image??
public class ImageConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
byte[] buffer = value as byte[];
**Stream memStream = new MemoryStream(buffer);**
WriteableBitmap wbimg = PictureDecoder.DecodeJpeg(memStream);
return wbimg;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
}
I had found another similar post had same error with me. System.ArgumentException was unhandled Message=The parameter is incorrect. - App Hub ForumsBut don't understand the coding..Anyone know how to solve the error? Or any other reference for me to retrieve image??
Last edited: