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

修正头像类

上级 e5131d19
......@@ -17,7 +17,7 @@ namespace ClientsLibrary
/// </summary>
public class UserPortrait
{
public UserPortrait(string filePath,Action<string> loadPic)
public UserPortrait(string filePath,Action<string> loadPic,Action disPic)
{
if (!System.IO.Directory.Exists(filePath))
{
......@@ -25,12 +25,14 @@ namespace ClientsLibrary
}
FileSavePath = filePath;
LoadPic = loadPic;
DisPic = disPic;
}
private string FileSavePath { get; set; }
private Action<string> LoadPic = null;
private Action DisPic = null;
public void ChangePortrait()
{
using (FormPortraitSelect fps = new FormPortraitSelect())
......@@ -40,6 +42,8 @@ namespace ClientsLibrary
string path300 = FileSavePath + @"\" + PortraitSupport.LargePortrait;
string path32 = FileSavePath + @"\" + PortraitSupport.SmallPortrait;
DisPic?.Invoke();
Bitmap bitmap300 = fps.GetSpecifiedSizeImage(300);
bitmap300.Save(path300);
Bitmap bitmap32 = fps.GetSpecifiedSizeImage(32);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册