コード例 #1
0
ファイル: frmEditProfile.cs プロジェクト: bansicloud/Mesh-1
        private void mnuChangePhoto_Click(object sender, EventArgs e)
        {
            using (frmImageDialog frm = new frmImageDialog())
            {
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    _profileImage = frm.SelectedImage;
                    picIcon.Image = _profileImage;

                    picIcon.Visible = true;
                    labIcon.Visible = false;
                }
            }
        }
コード例 #2
0
        private void mnuChangePhoto_Click(object sender, EventArgs e)
        {
            using (frmImageDialog frm = new frmImageDialog())
            {
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    _profileImage = frm.SelectedImage;
                    picIcon.Image = _profileImage;

                    using (MemoryStream mS = new MemoryStream(4096))
                    {
                        frm.SelectedImage.Save(mS, System.Drawing.Imaging.ImageFormat.Jpeg);
                        _peer.Network.Node.UpdateProfileDisplayImage(mS.ToArray());
                    }

                    _changesMade = true;

                    picIcon.Visible = true;
                    labIcon.Visible = false;
                }
            }
        }