private void btnGuardar_Click(object sender, EventArgs e) { try { //Comprimir la imagen Image ImagenHuella = ComprimirImagen.ResizeImage(this.ImgHuella.Image, 250, 250, ImageFormat.Png); //Guardarla en una ruta especifica ImagenHuella.Save(Path.Combine(System.Windows.Forms.Application.StartupPath, @"Resources\Huella\" + this.DatosEmpleado.IDEmpleado + ".png")); //Obtener la imagen en bytes System.IO.MemoryStream ms = new System.IO.MemoryStream(); ImagenHuella.Save(ms, ImageFormat.Png); this.DatosEmpleado.BufferHuella = ms.GetBuffer(); this.DatosEmpleado.IDUsuario = Comun.IDUsuario; this.DatosEmpleado.Conexion = Comun.Conexion; MemoryStream fingerprintData = new MemoryStream(); Lector.Template.Serialize(fingerprintData); fingerprintData.Position = 0; BinaryReader br = new BinaryReader(fingerprintData); byte[] bytes = br.ReadBytes((Int32)fingerprintData.Length); this.DatosEmpleado.HuellaString = ConvertirStringToBytes.getString(bytes); Usuario_Negocio UN = new Usuario_Negocio(); UN.AsignarHuellaXIDEmpleado(DatosEmpleado); if (this.DatosEmpleado.Completado) { MessageBox.Show("Datos guardados correctamente.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.OK; } else { MessageBox.Show("Ocurrió un error al guardar los datos. Intente nuevamente.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmCatEmpleadoHuella ~ btnGuardar_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }