Results 1 to 2 of 2

Thread: Minimising Memory Usage

  1. #1

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349

    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,
    We don't know what's wrong. . . So the best bet might be to remove something surgically.

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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....
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width