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);
}
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jeeva SubburajPosted Jun 27, 2018, 1:01 PM
Manav PandyaPosted Jun 27, 2018, 7:41 AM