适配新的头像下载类机制
This commit is contained in:
@@ -575,12 +575,16 @@ namespace 软件系统客户端Wpf
|
|||||||
{
|
{
|
||||||
SoftUserPortrait = new UserPortrait(AppDomain.CurrentDomain.BaseDirectory + @"\Portrait\" + UserClient.UserAccount.UserName,
|
SoftUserPortrait = new UserPortrait(AppDomain.CurrentDomain.BaseDirectory + @"\Portrait\" + UserClient.UserAccount.UserName,
|
||||||
m => {
|
m => {
|
||||||
|
byte[] content = System.IO.File.ReadAllBytes(m);
|
||||||
BitmapImage bi = new BitmapImage();
|
BitmapImage bi = new BitmapImage();
|
||||||
bi.BeginInit();
|
bi.BeginInit();
|
||||||
bi.UriSource = new Uri(m, UriKind.RelativeOrAbsolute);
|
bi.StreamSource = new System.IO.MemoryStream(content);
|
||||||
bi.EndInit();
|
bi.EndInit();
|
||||||
bi.Freeze();
|
|
||||||
AccountPortrait.Source = bi;
|
AccountPortrait.Source = bi;
|
||||||
|
},
|
||||||
|
()=>
|
||||||
|
{
|
||||||
|
AccountPortrait.Source = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ namespace 软件系统客户端模版
|
|||||||
|
|
||||||
private void SoftUserPortraitInitialization()
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user