TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vaibhav Singh
NA
132
22.8k
Save System.Drawing.Image File to your Local Computer
Jan 27 2019 7:56 AM
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.
<pre>Solving: A generic error occurred in GDI+. in C#</pre>
Is there anyone who had faced this kind of stuff and was able to save the image finally in local ?
Below is the code
<pre>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);
}
}</pre>
Reply
Answers (
2
)
what are 3 levels at which content pages can be attached ?
Can't Start VS Code without Internet connection