Posted 15 November 2022, 8:12 am EST
Hi to all,
i found the following anomaly:
Let’s imagine we have a grid that must display the photos of 1000 articles (each photo 1MB).
I handled the situation through the FetchCellStyle with the following code:
e.CellStyle.BackgroundImage = LoadFromFile(fullFileName);
e.CellStyle.BackgroundPictureDrawMode = BackgroundPictureDrawModeEnum.Fill;
If I click on the grid and quickly scroll the lines with the down arrow, the resources increase a lot until we get to the memory overflow exception.
I had to solve using OwnerDrawCell and with the code:
e.Graphics.DrawImage(image, rectangle);
However the resulting code is much slower.
Is there any way to fix?
Thank you