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; } } }
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; } } }