private void button2_Click(object sender, EventArgs e) { try { if (pictureBox1.Image != null) { if (_dato == "Usuarios") { Bitmap img = new Bitmap(pictureBox1.Image, 320, 240); Usuarios usuarios = Owner as Usuarios; usuarios.AsignarFoto(img); this.Close(); } if (_dato == "Choferes") { Bitmap img = new Bitmap(pictureBox1.Image, 320, 240); Choferes chofer = Owner as Choferes; chofer.AsignarFoto(img); this.Close(); } if (_dato == "Socios") { Bitmap img = new Bitmap(pictureBox1.Image, 320, 240); Socios socios = Owner as Socios; socios.AsignarFoto(img); this.Close(); } if (_dato == "socioalterno") { this.WindowState = FormWindowState.Minimized; Bitmap img = new Bitmap(pictureBox1.Image, 320, 240); Socios socios = Owner as Socios; socios.AsignarFotoalterno(img); this.Close(); } } else { MessageBox.Show("El driver de la webcam no esta instalado ."); } } catch (Exception err) { string error = err.Message; MessageBox.Show("Ocurrio un Error, intente de nuevo."); string funcion = "button2(seleccionarfoto)"; Utilerias.LOG.write(_clase, funcion, error); } }