1
I’m having the following mistake Generic error of GDI+. when trying to save the image in a specific directory. I am using code below.
string caminho=@"\\\10.1.1.10\\sistema";
Stream myStream = null;
OpenFileDialog abrir = new OpenFileDialog();
abrir.Filter = "Images (*.BMP;*.JPG;*.GIF,*.PNG,*.TIFF)|*.BMP;*.JPG;*.GIF;*.PNG;*.TIFF|" + "All files (*.*)|*.*";
abrir.FilterIndex = 1;
abrir.RestoreDirectory = true;
if (abrir.ShowDialog() == DialogResult.OK)
{
if ((myStream = abrir.OpenFile()) != null)
{
using (myStream)
{
Bitmap imagem = new Bitmap(abrir.FileName);//Pega o nome do arquivo escolhido
Bitmap igm = new Bitmap(imagem, 119, 110);//Padronisa o tamanho da imagaem ao picturebox
ImagemCamera.Image = igm;
ImagemCamera.Image.Save(caminho + "\\Fotos" + "\\" + Foto + "\\" + FotoId + ".Png", System.Drawing.Imaging.ImageFormat.Png);
}
}
someone can help me?
What is
ImagemCamera
?– Leonel Sanches da Silva
@Gypsy omorrisonmendez Thank you for asking. is the name of my picturebox.
– Fabrício Mendes