我有一张图片 String myimg = "images.jpg";
,我想设置ImageStream
为mediaHistoryItem
我试过这段代码:
if (mediaHistoryItem.ImageStream == null)
{
StreamResourceInfo sri = Application.GetResourceStream(new Uri("real.jpg", UriKind.Relative));
Stream stream = sri.Stream;
mediaHistoryItem.ImageStream = stream;
}
但它给了我例外NullreferenceException
。