-
Minimising Memory Usage
Hi Guys,
I have built an app that collects images from a users computer and allows them to specify their order and so forth. Basically it means that they have 24 images in the system and they can drag and drop them around the form.
I have this one client who continually crashes the system on this one page. It contains 24 image boxes and 24 text boxes, as well as associated buttons for general stuff. The user can swap images, or delete or copy them using drag and drop. The image boxes are 81 x 81 pixels.
I think this client is crashing the system by using ridiculously large images - 1179 x 769 and thereabouts. Having said that, my question is - How can i minimise the memory usage for a page like this? Is there a more efficient API i could use or some way to store an array of thumbnails in memory, so i don't have to continually reprocess them?
Anyway, I'm not sure, so i hope someone can help me.
Thanx all in advance,
-
Hmmm.
Well if you were to load the images into device contexts, then you could just display them as needs be.
But that would still use up lots of memory...
What you could do right, is if you generate a device context for the image, then BitBlt (or StretchBlt) the image into a picturebox, and then delete the device context.
That would get the image onto the screen, without needing it in memory.
Though I'm not sure what effect that would have on repaints/refreshes....