Esempio n. 1
0
        }//-----------------------------

        //####################################################END COMBOBOX cboGender EVENTS###############################################

        //####################################################PICTUREBOX pbxPerson EVENTS###############################################
        //event is raised when the control is clicked
        protected void pbxPersonClick(object sender, EventArgs e)
        {
            using (OpenFileDialog imageChooser = new OpenFileDialog())
            {
                imageChooser.Title           = "Select an image";
                imageChooser.Filter          = "All image file (*.jpg, *.jpeg, *.bmp, *.gif) | *.jpg; *.jpeg; *.bmp; *.gif";
                imageChooser.Multiselect     = false;
                imageChooser.CheckFileExists = true;
                imageChooser.CheckPathExists = true;

                //determines if an image has been Selected
                if (imageChooser.ShowDialog() == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;

                    this.pbxPerson.Image = Image.FromFile(imageChooser.FileName);

                    _personInfo.FilePath = imageChooser.FileName;

                    _personInfo.FileData      = RemoteClient.ProcStatic.GetFileArrayBytes(_personInfo.FilePath);
                    _personInfo.FileName      = Path.GetFileName(_personInfo.FilePath);
                    _personInfo.FileExtension = _baseServiceManager.GetImageExtensionName(_personInfo.FilePath);

                    this.Cursor = Cursors.Arrow;
                }
            }
        }//---------------------------------