0
私はWP7から連絡先を取得しています。いくつかの連絡先には画像がありません。私は既定のイメージを持っていない連絡先を表示したい。それには、私は以下の画像変換器を使用していたWP7の画像からDecodeJpegを返す
、
public class ContactPictureConverter : System.Windows.Data.IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Contact c = value as Contact;
if (c == null) return null;
System.IO.Stream imageStream = c.GetPicture();
if (null != imageStream)
{
return Microsoft.Phone.PictureDecoder.DecodeJpeg(imageStream);
}
else
{
return null;
}
}
のImageStreamがnullの場合は、その後、私は私のデフォルトの画像を返すようにしたいです。
これを行う方法?
が:-) ...それは良い働いている...あなたのNasenbaerありがとう – Ponmalar