用户
 找回密码
 立即注册

65

主题

184

帖子

998

积分

高级会员

Rank: 4

积分
998
发表于 2016-4-19 22:02:08
    private void btnUpUserImg_Click(object sender, EventArgs e)
    {
        try
        {
            this.Camera1.GetPhoto((object sender1, BinaryData data) =>
            {
                if (string.IsNullOrEmpty(data.ErrorInfo))
                {
                    string path = AppDomain.CurrentDomain.BaseDirectory + "\\Icon\\";
                    if (System.IO.Directory.Exists(path) == false)
                    {
                        System.IO.Directory.CreateDirectory(path);
                    }
                    using (System.IO.FileStream stream = System.IO.File.Create(path + data.ResourceID, data.Length))
                    {
                        stream.Write(data.Data, 0, data.Length);
                    }
                    btnUpUserImg.ResourceID = data.ResourceID;
                }
            });
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }



1.  选择从相机选择图片,APP直接关闭

2. 选择从相册选择图片,图片正常上传到服务器,但是用户头像( btnUpUserImg)没正常显示。

分享至 : QQ空间
0 人收藏
使用道具 举报 回复
发表于 2016-4-20 11:22:30
感谢您的反馈,您试一下最新版本Designer和客户端http://www.smobiler.com/downloadpc.aspx
最新Demo地址https://github.com/comsmobiler/demo-coms

使用道具 举报 回复 支持 反对
发表于 2016-4-21 00:58:17
开始用新版本了。
使用道具 举报 回复 支持 反对
发新帖
您需要登录后才可以回帖 登录 | 立即注册