Jump to content
  • Advertisement
Sign in to follow this  
doctorhair1

[.net] Quick .NET question

This topic is 4340 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey I'm fairly new to .NET but luckly I am pretty familer with C++/C# so I so far have been able to guess my way around how to do things until just now. My question is though I have users select a bunch of images and it generates a preview on the fly (example: http://www.stvproductionz.com/images/gallery(4).jpg). But I can't delete the images when the user chooses too. It just deletes the last image generated when I referance it by name. Any ideas? Maybe a way to loop through a list and delete them all? Thanks. This will also be useful for me to learn so I can edit the images. :)

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by doctorhair1
But I can't delete the images when the user chooses too. It just deletes the last image generated when I referance it by name.

I am uncertain of what you mean here; do you by 'delete image' mean 'delete image from harddisk'? So the thumbnails are temporary image files on the harddisk?

I guess some code would help.

Share this post


Link to post
Share on other sites
If you are no longer referencing the object (System::Drawing::Image), then the garbage collector will eventually collect it up and free the memory for you.
However, Image is an example that uses unmanaged memory (it wraps GDI+), so calling Dispose() when you no longer need it will speed this process up by dumping the unmanaged memory immediatly.

So pretty much emptying the list will effectivly delete the objects from memory.

Share this post


Link to post
Share on other sites
When I do that it only erases one of the images from the displayed images though when I call Dispose(). Maybe I am doing something wrong. I'll post my code tonight.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!