Sign in to follow this  
doctorhair1

[.net] Quick .NET question

Recommended Posts

doctorhair1    100
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
Enselic    829
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
RipTorn    722
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this