【发布时间】:2012-05-08 06:58:05
【问题描述】:
总的来说,我是 xaml 和 wpf 的新手。 我正在尝试使图像出现在用户控件中,这是我使用的代码:
BitmapImage captchaSource = new BitmapImage();
captchaSource.BeginInit();
captchaSource.UriSource = new Uri(_captchaData.ImgUrl);
captchaSource.EndInit();
captchaImg.Source = captchaSource;
这是用户界面代码:
<Image Height="105" HorizontalAlignment="Left" Margin="12,38,0,0" Name="captchaImg" Stretch="Fill" VerticalAlignment="Top" Width="276" Grid.ColumnSpan="2" />
但是什么也没发生。没有图像出现。这是 _captchaData.ImgUrl http://www.google.ro/images/srpr/logo3w.png 中的 url
有人知道这是为什么吗?
【问题讨论】: