提交 1e717361 编写于 作者: Richard__Hu's avatar Richard__Hu

适配新的头像下载类机制

上级 a3356dc6
......@@ -575,12 +575,16 @@ namespace 软件系统客户端Wpf
{
SoftUserPortrait = new UserPortrait(AppDomain.CurrentDomain.BaseDirectory + @"\Portrait\" + UserClient.UserAccount.UserName,
m => {
byte[] content = System.IO.File.ReadAllBytes(m);
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(m, UriKind.RelativeOrAbsolute);
bi.StreamSource = new System.IO.MemoryStream(content);
bi.EndInit();
bi.Freeze();
AccountPortrait.Source = bi;
},
()=>
{
AccountPortrait.Source = null;
});
}
......
......@@ -630,7 +630,7 @@ namespace 软件系统客户端模版
private void SoftUserPortraitInitialization()
{
SoftUserPortrait = new UserPortrait(Application.StartupPath + @"\Portrait\" + UserClient.UserAccount.UserName, m => pictureBox1.LoadAsync(m));
SoftUserPortrait = new UserPortrait(Application.StartupPath + @"\Portrait\" + UserClient.UserAccount.UserName, m => pictureBox1.LoadAsync(m),null);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册