Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Picture Boxes and running out of memory

MrEdMrEd Posts: 180Member
Im new to VB.NET but have used VB6 quite a bit. Im writing an app with a picture box that I use as an image browser. ie I set the image to a JPEG picture and when the user hits a key i set it to another JPEG picture etc. But after showing about 20 pictures, it seems to run out of memory. Ive tried using Dispose to unload the current image before loading a new one but it doesnt seem to work. Can anyone tell me what i need to do?

This is what my code does repeatedly:
picPicture.Image = Image.FromFile(FileName)

Comments

  • MrEdMrEd Posts: 180Member
    : Im new to VB.NET but have used VB6 quite a bit. Im writing an app with a picture box that I use as an image browser. ie I set the image to a JPEG picture and when the user hits a key i set it to another JPEG picture etc. But after showing about 20 pictures, it seems to run out of memory. Ive tried using Dispose to unload the current image before loading a new one but it doesnt seem to work. Can anyone tell me what i need to do?
    :
    : This is what my code does repeatedly:
    : picPicture.Image = Image.FromFile(FileName)
    :

    OK, i figured it out. A bit of an oops on my part. It was always crashing on the same image, which isnt actually an image, its an AVI file :) And since the picture box doesnt support AVI files, it gives an out of memory exception (according to MSDN, but i dont know why).
Sign In or Register to comment.