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
Karthi Keyan
996
755
238.8k
Exception : Out of Memory.
Jun 27 2018 5:45 AM
Hi guys,
I got Out of Memory Exception while run the below code. I dont know how to resolve this. Will appreciate if somebody help me.
foreach (var file in Directory.GetFiles(Path.GetDirectoryName(txtinputimage.Text) + "\\Thumbnail").ToList().Where(k => !k.EndsWith(".thumb")))
{
Image image = Image.FromFile(file); // Got the Exception in this line.
Image thumb = image.GetThumbnailImage(180, 120, () => false, IntPtr.Zero);
thumb.Save(Path.ChangeExtension(file, "thumb"));
image.Dispose();
thumb.Dispose();
File.Delete(file);
}
Reply
Answers (
2
)
Learning New tech
about programming