Sobrescribir el cuadro de imagen en C #
Estoy haciendo una aplicación, agrego un cuadro de imagen para agregar imagen a algunos productos, tengo una pregunta, me gustaría editar las imágenes ya agregadas a un producto, ¿cómo puedo hacer eso? Este es mi código real.
private void pbImagenEquipo_DoubleClick(object sender, EventArgs e)
{
ofdImagenes.Filter = "Imagenes JPG (*.jpg)|*.jpg; *.jpeg;|Imagenes PNG (*.png)|*.png";
DialogResult resp = ofdImagenes.ShowDialog();
if (resp == DialogResult.OK)
{
Bitmap b = new Bitmap(ofdImagenes.FileName);
string [] archivo = ofdImagenes.FileName.Split('.');
nombre = "Equipo_" + lbID+ "." + archivo[archivo.Length-1];
b.Save(Path.Combine(Application.StartupPath, "Imagenes", nombre));
pbImagenEquipo.Image = b;
}
}
Pero cuando trato de reemplazar la imagen recibí este error:
An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in System.Drawing.dll
Additional information: Error generoc in e GDI+.