private void cmdGuardar_Click(object sender, EventArgs e) { try { if (_heDibujado) { Bitmap fondo = new Bitmap(bmp.Width, bmp.Height); Graphics g = Graphics.FromImage(fondo); g.FillRectangle(new SolidBrush(pictureBox1.BackColor), 0, 0, bmp.Width, bmp.Height); g.Dispose(); Unir(fondo); //se guarda la imagen string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); string userFilePath = Path.Combine(localAppData, "MIT"); string file = userFilePath + "\\firmaPanel.png"; string fileAgua = userFilePath + "\\firmaPanelAgua.png"; if (CarpetaExiste(userFilePath)) { bmp.Save(file, ImageFormat.Png); //Imagen.MarcaAguaTexto(file, TextoMarcaAgua, fileAgua); Imagen objImage = new Imagen(); objImage.MarcaAguaTexto(file, TextoMarcaAgua, fileAgua); //pictureBox1.Load(fileAgua); //se obtiene el hexadecimal de la imagen byte[] image = File.ReadAllBytes(fileAgua); //StrHexadecimal = Imagen.BytesToHexadecimal(image); StrHexadecimal = objImage.BytesToHexadecimal(image); //Se inhabilitan los controles pictureBox1.Enabled = false; cmdLimpiar.Enabled = false; cmdGuardar.Enabled = false; this.Close(); } } else { MessageBox.Show("Debes firmar en el recuadro blanco."); } } catch (Exception ex) { ErrorFrm = ex.Message; } }