Lets say that I have fetched an Image called img from my Database and Now I want to save it in my Local.
I am getting below Error for same.
Code
Solving: A generic error occurred in GDI+. in C#Is there anyone who had faced this kind of stuff and was able to save the image finally in local ?
Below is the code
C#
public static void SavePic(Image img)
{
Image result = null;
ImageFormat format = ImageFormat.Png;
result = img;
using (Image imageToExport = result)
{
string filePath = string.Format(@"C:\Vaibhav Personal.{0}", format.ToString());
imageToExport.Save(filePath, format);
}
}

Salman BegRank #284 · 8.8K reputationPosted Jan 27, 2019, 3:33 AM EST
Marvin ReidRank #1,963 · 746 reputationPosted Dec 31, 2020, 3:29 PM EST