Relative Content

Tag Archive for c#out-of-memory

Out of memopy. C#

So, I’m making a WinForms application and I need to convert an image to a Base64 string and add it to an xlsx data table. I then read this data and add it to the DataGridView. But on top of that I am also taking the Base64 string and converting it back to a picture and inserting it into a pictureBox(I have a gridBox). And the problem is that in the string
gridBox.BackgroundImage = Image.FromStream(memoryStream);
exception out of memory occurs. Base64 string is correct, I copied it and ran it through online converter. Maybe the size is too big, though not that big, maybe there are some other subtleties…. Please help me to understand. Thanks in advance!
Here are parts of the code:
Encoding: